feat(markdown,value): record code span delimiters, inert-executable code and profile refinements
- md code nodes now carry `ticks` (delimiter length) so executable payload offsets inside code spans map back to exact source bytes instead of pointing at backticks; this keeps diagnostics precise for mixed text/code payloads. - value: add the markdown.inert_executable warning code and a small clippy fix, without changing the wire format. - spec: document the code-span tick metadata, declare strikethrough lazy, and make the inert-execution warning explicit for nodes outside any function. - workspace dependencies: add unicode-ident (grammar) and glob (capability path patterns) for the frontend/host layers. Tests: 15 markdown + 10 value + 2 span tests pass; fmt/clippy clean.
This commit is contained in:
1 parent
4db6e6afd6
commit
62a9af05fd
9 files changed
+34
-15
No files matched your search
+8
-1
@@ -50,6 +50,8 @@ content is never executed:
|
||||
* heading text (headings scope, they do not run)
|
||||
* `link` labels and `image` alt text
|
||||
* `table` cells (tables are document values)
|
||||
* `strikethrough` wrappers: their content is inert prose and is not traversed
|
||||
for execution; do not rely on formatting to hide executable nodes
|
||||
* `code_block` and inline `code` outside designated payload positions
|
||||
* `math` / `math_block`
|
||||
* `html_block` / `html_inline`
|
||||
@@ -78,7 +80,12 @@ including inside branch and loop bodies:
|
||||
Outside functions (module top-level prose) the same executable nodes are inert
|
||||
document content (S-03 in the blueprint: executable lists/strong/emph only run
|
||||
inside a function body). The single exception is `main` itself, which is a
|
||||
function.
|
||||
function. To make this explicit rather than silent, the frontend emits a
|
||||
`markdown.inert_executable` **warning** for every would-be execution node found
|
||||
outside a function body; the document still compiles and the node does nothing.
|
||||
|
||||
Headings inside container blocks (block quotes, list items) or fenced code never
|
||||
create functions and never execute inline markup.
|
||||
|
||||
### 4.1 Strict payload extraction
|
||||
|
||||
|
||||
@@ -97,7 +97,9 @@ Rules:
|
||||
`raw` payload of unmodelled nodes.
|
||||
* `link`/`image` embed `url` and `title`; `heading` embeds `level` and
|
||||
`setext`; `list` embeds `ordered`, optional `start` and `tight`; `table`
|
||||
embeds column `alignments`; `table_row` embeds `header`.
|
||||
embeds column `alignments`; `table_row` embeds `header`; inline `code`
|
||||
embeds `ticks` (delimiter length) so payload offsets can be mapped back to
|
||||
exact source bytes (a code span's source span includes its backticks).
|
||||
* Unmodelled parser nodes are preserved as `{"kind":"other","tag":"..."}`
|
||||
with their children and raw literal. They are inert for the language.
|
||||
* Attribute order in JSON is fixed by the serializer and goldens are
|
||||
|
||||
Reference in new issue
Block a user