Skip to content

Preserve dash escapes from markdown to typst conversion #11334

@terefang

Description

@terefang

i have the following markdown table cells:

+-------------------+---------------------------+---------------------------+---------------------------+
|   clubs ^--^      |   baseball bat    ^-\-+^  |  pool stick handle ^-\-0^ |   billy club    ^\-\-\-^  |
+-------------------+---------------------------+---------------------------+---------------------------+

i use the following format options

--from markdown+pipe_tables+grid_tables+raw_attribute+raw_html+fenced_divs+yaml_metadata_block-tex_math_dollars-smart
--ascii

that is converted into typst:

grid.cell(
[
clubs #super[\--]
]),
grid.cell(
[
baseball bat #super[\--+]
]),
grid.cell(
[
pool stick handle #super[\--0]
]),
grid.cell(
[
billy club #super[\---]
]),

here is the native dump:

, Row
                  ( "" , [] , [] )
                  [ Cell
                      ( "" , [] , [] )
                      AlignDefault
                      (RowSpan 1)
                      (ColSpan 1)
                      []
                  , Cell
                      ( "" , [] , [] )
                      AlignDefault
                      (RowSpan 1)
                      (ColSpan 1)
                      [ Plain
                          [ Str "clubs"
                          , Space
                          , Superscript [ Str "--" ]
                          ]
                      ]
                  , Cell
                      ( "" , [] , [] )
                      AlignDefault
                      (RowSpan 1)
                      (ColSpan 1)
                      [ Plain
                          [ Str "baseball"
                          , Space
                          , Str "bat"
                          , Space
                          , Superscript [ Str "--+" ]
                          ]
                      ]
                  , Cell
                      ( "" , [] , [] )
                      AlignDefault
                      (RowSpan 1)
                      (ColSpan 1)
                      [ Plain
                          [ Str "pool"
                          , Space
                          , Str "stick"
                          , Space
                          , Str "handle"
                          , Space
                          , Superscript [ Str "--0" ]
                          ]
                      ]
                  , Cell
                      ( "" , [] , [] )
                      AlignDefault
                      (RowSpan 1)
                      (ColSpan 1)
                      [ Plain
                          [ Str "billy"
                          , Space
                          , Str "club"
                          , Space
                          , Superscript [ Str "---" ]
                          ]
                      ]
                  ]
              ]

the typst pdf output looks like:

Image

is there a bug in the escaping of dashes that should not be converted to emdash ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions