PMunch / nim-playground-frontend

The front-end for https://play.nim-lang.org
45 stars 16 forks source link

doc comments content isn't highlighted as comment #17

Open timotheecour opened 4 years ago

timotheecour commented 4 years ago
#[
asdf
]#

proc foo*()=
  runnableExamples:
    import std/strutils
    ## line_doc_comment
    # bar
    doAssert "'foo" == "'foo"
    ##[
    foo
    bar
    ]##
    doAssert: not "foo".startsWith "ba"

curious what's used for syntax highlighting; github (via github linguist, see nim entry in https://github.com/github/linguist/tree/master/vendor/grammars) and other tools use https://github.com/Varriount/NimLime which doesn't have this problem

in playground it renders as: image

PMunch commented 4 years ago

Since the plaground uses CodeMirror it uses CodeMirror's own syntax support. The specific Nim version can be found here: https://github.com/PMunch/nim-playground-frontend/blob/master/codemirror/mode/nim/nim.js, PRs welcome to add multiline doc comments.