Skip to content

issue better error message on encountering old-style code chunk options #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

    enhancementNew feature or requesterror-messagesissues about failures in error reportingreaders-writersParsing issues, round-trip discrepancies, writer bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions