Highlight Nim default in Markdown code in .nim (#20110)
Highlight Nim by default in Markdown code in .nim
This commit is contained in:
parent
99dd588d6b
commit
40e0048a50
4 changed files with 28 additions and 13 deletions
|
|
@ -474,7 +474,12 @@ suite "RST parsing":
|
|||
let expectCodeBlock = dedent"""
|
||||
rnCodeBlock
|
||||
[nil]
|
||||
[nil]
|
||||
rnFieldList
|
||||
rnField
|
||||
rnFieldName
|
||||
rnLeaf 'default-language'
|
||||
rnFieldBody
|
||||
rnLeaf 'Nim'
|
||||
rnLiteralBlock
|
||||
rnLeaf '
|
||||
let a = 1
|
||||
|
|
|
|||
|
|
@ -582,9 +582,14 @@ Test literal block
|
|||
```
|
||||
let x = 1
|
||||
``` """
|
||||
let output1 = input1.toHtml
|
||||
let output1 = input1.toHtml({roSupportMarkdown, roPreferMarkdown})
|
||||
doAssert "<pre" in output1 and "class=\"Keyword\"" notin output1
|
||||
|
||||
# Check Nim highlighting by default in .nim files:
|
||||
let output1nim = input1.toHtml({roSupportMarkdown, roPreferMarkdown,
|
||||
roNimFile})
|
||||
doAssert "<pre" in output1nim and "class=\"Keyword\"" in output1nim
|
||||
|
||||
let input2 = """
|
||||
Parse the block with language specifier:
|
||||
```Nim
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue