Skip to content

emph in parens #76

Description

@melisgl
CL-USER> (3bmd-grammar:parse-doc "(_xxx_)")
((:PLAIN "(_xxx" "_" ")"))
NIL
T
CL-USER> (3bmd-grammar:parse-doc "(*xxx*)")
((:PLAIN "(" (:EMPH "xxx") ")"))
NIL
T

The inconsistency is because of

(defrule string (and normal-char (* (or normal-char (and (+ #\_) maybe-alphanumeric))))
  (:text t))

Without going full CommonMark, would it make sense to change this in parser.lisp?

@@ -36,6 +36,7 @@
 (defrule normal-char (and (! (or special-char space-char newline)) character)
   (:text t))
 (defrule special-char (or #\* #\_ #\` #\& #\[ #\] #\< #\! #\# #\\
+                          #\( #\) #\{ #\}
                           extended-special-char)
   (:text t))

which seems to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions