Skip to content

Code-blocks, nested into a list items aren't supported #45

@svetlyak40wt

Description

@svetlyak40wt

There are two problems:

  • Parsed code goes as a list item's sibling despite that it has the same indentation as item's content.
  • And they are parsed as inline code instead of CODE-BLOCK.
40ANTS-DOC-TEST/UTILS-TEST> (let ((3bmd-code-blocks:*code-blocks* t))
                              (3bmd-grammar:parse-doc "
* Added a warning mechanism, which will issue such warnings on words which looks
  like a symbol, but when real symbol or reference is absent:

  ```
  WARNING: Unable to find symbol \"API\" mentioned in (CL-INFO:@INDEX SECTION)
  ```
"))
((:BULLET-LIST
  (:LIST-ITEM
   (:PLAIN "Added" " " "a" " " "warning" " " "mechanism," " " "which" " "
    "will" " " "issue" " " "such" " " "warnings" " " "on" " " "words" " "
    "which" " " "looks" "
"
    "  " "like" " " "a" " " "symbol," " " "but" " " "when" " " "real" " "
    "symbol" " " "or" " " "reference" " " "is" " " "absent:")))
 (:PLAIN "  "
  (:CODE "
  WARNING: Unable to find symbol \"API\" mentioned in (CL-INFO:@INDEX SECTION)
")))
NIL
T

When there is now indentation, than code block is parsed correctly:

40ANTS-DOC-TEST/UTILS-TEST> (let ((3bmd-code-blocks:*code-blocks* t))
                              (3bmd-grammar:parse-doc "
```
WARNING: Unable to find symbol \"API\" mentioned in (CL-INFO:@INDEX SECTION)
```
"))
((3BMD-CODE-BLOCKS::CODE-BLOCK :LANG "" :PARAMS NIL :CONTENT
  "WARNING: Unable to find symbol \"API\" mentioned in (CL-INFO:@INDEX SECTION)"))
NIL
T

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