Rock It 《ML》JupyterLab 【乙】Markdown 《D》

當人剛開始用 Markdown 撰寫文本時,可能感覺借Enter『斷句』另起新行

Paragraphs and line breaks

You can create a new paragraph by leaving a blank line between lines of text.

得不到想要的輸出結果︰

也許他想要的是這種呈現耶?

由於不知道那可以用『句後』加上 □ □ 『兩個空白』達成也。恐怕會不高興呦!

如是面對『表格』如何『格式化』 Formatting  之顯示問題,大概會更不快樂的吧!!

※ 參讀

Formatting content within your table

You can use formatting such as links, inline code blocks, and text styling within your table:

You can align text to the left, right, or center of a column by including colons : to the left, right, or on both sides of the hyphens within the header row.

To include a pipe |  as content within your cell, use a \ before the pipe:

……

※註‧Markdown table alignment #3024

 

這還沒提及之前 Jupyter notebook 可用的 HTML 『標記』哩!?

JupyterLab removing HTML style attribs #1812

Markdown not working #4160

Allow additional tags in sanitizer #4618

……

 

終究得要評估『安全』︰

Security in the Jupyter notebook server

Since access to the Jupyter notebook server means access to running arbitrary code, it is important to restrict access to the notebook server. For this reason, notebook 4.3 introduces token-based authentication that is on by default.

 

與否的乎?!

 

實則 JupyterLab 樂於從善如流︰

JupyterLab Changelog

v0.35.0

October 3, 2018

See the JupyterLab 0.35.0 milestone on GitHub for the full list of pull requests and issues closed.

Features

  • A notebook cell can now be readonly, reflecting its enabled metadata. (#5401, #1312)
  • Add “Go To Line” in the Edit menu for text editors. (#5377)
  • Sidebar panels can now be switched between left and right sidebars. Right-click on a sidebar tab to move it to the other sidebar. (#5347, #5054, #3707)
  • Make the sidebar a bit narrower, and make the minimum width adjustable from a theme. (#5245)
  • Populate the File, Export Notebook As… submenu from the server nbconvert capabilities. (#5217)
  • Server contents managers can now tell JupyterLab to open files as notebooks. For example, several custom contents managers save and open notebooks as Markdown files. (#5247, #4924)
  • Add a command-line interface for managing workspaces. (#5166)
  • Allow safe inline CSS styles in Markdown. (#5012, #1812)
  • Add Quit to File menu when appropriate. (#5226, #5252, #5246, #5280)
  • Rework extension manager user experience. (#5147, #5042)

………

 

一時之不便,無須抱怨吧◎

/jupyterlab

jupyterlab/tests/test-apputils/src/sanitizer.spec.ts

import { expect } from 'chai';

import { defaultSanitizer } from '@jupyterlab/apputils/src';

describe('defaultSanitizer', () => {
  describe('#sanitize()', () => {
    it('should allow h1 tags', () => {
      const h1 = '<h1>foo</h1>';
      expect(defaultSanitizer.sanitize(h1)).to.equal(h1);
    });

    it('should allow h2 tags', () => {
      const h2 = '<h2>foo</h2>';
      expect(defaultSanitizer.sanitize(h2)).to.equal(h2);
    });

    it('should not allow svg tags', () => {
      const svg = '<svg>foo</svg>';
      expect(defaultSanitizer.sanitize(svg)).to.equal('foo');
    });
...