cherry-markdown icon indicating copy to clipboard operation
cherry-markdown copied to clipboard

fix:修改部分语法 hook,完善Cherry Commonmark语法解析

Open msdest565 opened this issue 3 years ago • 1 comments

236 通过修改语法 hook,完善Cherry Commonmark,并增加通过12个单测用例(通过 13 个测试,失败 1 个)。

pass example 62、63、69、329、332、337、377、419、434、437、440、440、443,fail example 428。

msdest565 avatar Aug 15 '22 16:08 msdest565

 // ATXheader.js passed 3

{
    "markdown": "# foo\n## foo\n### foo\n#### foo\n##### foo\n###### foo\n",
    "html": "<h1>foo</h1>\n<h2>foo</h2>\n<h3>foo</h3>\n<h4>foo</h4>\n<h5>foo</h5>\n<h6>foo</h6>\n",
    "example": 62,
    "start_line": 1113,
    "end_line": 1127,
    "section": "ATX headings"
  },
  {
    "markdown": "####### foo\n",
    "html": "<p>####### foo</p>\n",
    "example": 63,
    "start_line": 1132,
    "end_line": 1136,
    "section": "ATX headings"
  },
 {
    "markdown": "    # foo\n",
    "html": "<pre><code># foo\n</code></pre>\n",
    "example": 69,
    "start_line": 1199,
    "end_line": 1204,
    "section": "ATX headings"
  },
// inlinecode pass 3
 {
    "markdown": "`` foo ` bar ``\n",
    "html": "<p><code>foo ` bar</code></p>\n",
    "example": 329,
    "start_line": 5901,
    "end_line": 5905,
    "section": "Code spans"
  },
  {
    "markdown": "` `` `\n",
    "html": "<p><code>``</code></p>\n",
    "example": 330,
    "start_line": 5911,
    "end_line": 5915,
    "section": "Code spans"
  },
 {
    "markdown": "` a`\n",
    "html": "<p><code> a</code></p>\n",
    "example": 332,
    "start_line": 5928,
    "end_line": 5932,
    "section": "Code spans"
  },
 {
    "markdown": "`foo   bar \nbaz`\n",
    "html": "<p><code>foo   bar  baz</code></p>\n",
    "example": 337,
    "start_line": 5977,
    "end_line": 5982,
    "section": "Code spans"
  },
//emphasis.js pass 7,fail 1(example 428)
 {
    "markdown": "**foo bar**\n",
    "html": "<p><strong>foo bar</strong></p>\n",
    "example": 377,
    "start_line": 6569,
    "end_line": 6573,
    "section": "Emphasis and strong emphasis"
  },
  {
    "markdown": "** is not an empty emphasis\n",
    "html": "<p>** is not an empty emphasis</p>\n",
    "example": 419,
    "start_line": 6964,
    "end_line": 6968,
    "section": "Emphasis and strong emphasis"
  },
  {
    "markdown": "**foo*bar*baz**\n",
    "html": "<p><strong>foo<em>bar</em>baz</strong></p>\n",
    "example": 428,
    "start_line": 7038,
    "end_line": 7042,
    "section": "Emphasis and strong emphasis"
  },
  {
    "markdown": "____ is not an empty strong emphasis\n",
    "html": "<p>____ is not an empty strong emphasis</p>\n",
    "example": 434,
    "start_line": 7086,
    "end_line": 7090,
    "section": "Emphasis and strong emphasis"
  },
  {
    "markdown": "foo *_*\n",
    "html": "<p>foo <em>_</em></p>\n",
    "example": 437,
    "start_line": 7110,
    "end_line": 7114,
    "section": "Emphasis and strong emphasis"
  },
  {
    "markdown": "foo **_**\n",
    "html": "<p>foo <strong>_</strong></p>\n",
    "example": 440,
    "start_line": 7131,
    "end_line": 7135,
    "section": "Emphasis and strong emphasis"
  },
  {
    "markdown": "*foo**\n",
    "html": "<p><em>foo</em>*</p>\n",
    "example": 442,
    "start_line": 7149,
    "end_line": 7153,
    "section": "Emphasis and strong emphasis"
  },
  {
    "markdown": "***foo**\n",
    "html": "<p>*<strong>foo</strong></p>\n",
    "example": 443,
    "start_line": 7156,
    "end_line": 7160,
    "section": "Emphasis and strong emphasis"
  },

msdest565 avatar Sep 13 '22 05:09 msdest565