Skip to content

Minor qmd writer issues #152

@rundel

Description

@rundel

Chunks with old style options are mangled

An executable code block {r eval=FALSE} is re-written as {.{r} eval="FALSE"}.

$ printf -- '```{r eval=FALSE}\nx = 1\n```\n' | cargo run --bin pampa -- -t qmd
Warning: [Q-2-8] Code block options in header
. . .
```{.{r} eval="FALSE"}
x = 1
```

$ printf -- '```{r eval=FALSE}\nx = 1\n```\n' | cargo run --bin pampa --     
Warning: [Q-2-8] Code block options in header
. . .
[ CodeBlock ( "" , ["{r}"] , [("eval", "FALSE")] ) "x = 1" ]%    

Table caption attributes are not written

$ printf '%s\n' '| A | B |' '|---|---|' '| 1 | 2 |' '' ': ABCD {tbl-colwidths="[30,70]"}'
| A | B |
|---|---|
| 1 | 2 |

: ABCD {tbl-colwidths="[30,70]"}

$ printf '%s\n' '| A | B |' '|---|---|' '| 1 | 2 |' '' ': ABCD {tbl-colwidths="[30,70]"}' | cargo run --bin pampa -- -t qmd
| A   | B   |
| --- | --- |
| 1   | 2   |

: ABCD

$ printf '%s\n' '| A | B |' '|---|---|' '| 1 | 2 |' '' ': ABCD {tbl-colwidths="[30,70]"}' | cargo run --bin pampa --
[ Table ( "" , [] , [("tbl-colwidths", "[30,70]")] ) (Caption Nothing [ Plain [Str "ABCD"] ]) [(AlignDefault, ColWidthDefault), (AlignDefault, ColWidthDefault)] (TableHead ( "" , [] , [] ) [Row ( "" , [] , [] ) [Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "A"]] , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "B"]] ] ]) [TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [Row ( "" , [] , [] ) [Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "1"]] , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "2"]] ] ]] (TableFoot ( "" , [] , [] ) [] ) ]%   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions