`pandoc.read` has no HTML reader
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- backend-api-design
Direzione di ricerca
Start by locating the Lua API implementation of pandoc.read and how it dispatches supported reader formats; the issue does not name source files or tests. Compare the existing Markdown readers with the expected HTML AST output and identify the project’s reader tests. Done means pandoc.read(text, "html") handles common HTML elements as described, or the Lua API documentation lists unsupported reader formats if HTML support is not planned.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This issue was written by Claude while adding q2 support to Great Docs. The output shown comes from running each repro.
Bug description
In a Lua filter, pandoc.read(text, "html") raises "Unsupported reader format: html". q2's
readers are qmd, markdown, commonmark, json and raw-json. Under Quarto 1, filters commonly
use Pandoc's HTML reader to turn raw HTML into AST elements, for instance HTML returned by a
shortcode, or raw HTML blocks a filter wants to transform or convert to another format.
Great Docs writes a Markdown companion of every page, linked from the page as
<link rel="alternate" type="text/markdown">. Its markdown-pages filter reads each raw HTML block
and inline with pandoc.read(..., "html"), so that the content of shortcodes and generated HTML
appears in the Markdown. Under q2 those reads fail, and that content is left out of the companions.
Steps to reproduce
mkdir html-reader && cd html-reader
cat > read-html.lua <<'LUA'
function Pandoc(doc)
local ok, result = pcall(pandoc.read, "<p>Press <kbd>Ctrl</kbd> and <strong>save</strong>.</p>", "html")
if ok then
quarto.log.output(pandoc.write(result, "native"))
else
quarto.log.output("pandoc.read failed: " .. tostring(result))
end
end
LUA
printf -- '---\ntitle: Read HTML\nfilters:\n - read-html.lua\n---\n\nText.\n' > doc.qmd
q2 render doc.qmd
Actual behavior
pandoc.read failed: runtime error: Unsupported reader format: html. Supported formats: ["qmd", "markdown", "commonmark", "json", "raw-json"]
Expected behavior
As in Quarto 1.9.37:
[ Para
[ Str "Press"
, Space
, Span ( "" , [ "kbd" ] , [] ) [ Str "Ctrl" ]
, Space
, Str "and"
, Space
, Strong [ Str "save" ]
, Str "."
]
]
An HTML reader for pandoc.read, even one that covers only common elements (paragraphs, headings,
lists, tables, code, links, emphasis, and <span> and <div> with their attributes), would cover
most filter use. If it isn't planned, a list of the unsupported reader formats in the Lua API docs
would help extension authors.
- Lingua principale
- Rust
- Stelle
- 302
- Fork
- 22
- Merge medio
- 5h 2m
- PR unite (30g)
- 213
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di quarto-dev/q2
-
`dir: rtl` isn't written to `<html>` in HTML outputForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quarto-dev/q2#1219 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
quarto-dev/q2#1188 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
quarto-dev/q2#1179 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
quarto-dev/q2#1133 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
quarto-dev/q2#1103 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di quarto-dev/q2
Issue simili
-
priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
storytold/photocraft#15350 ·
I maintainer di solito rispondono entro 1 giorno
-
area:davinci
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ubugeeei-prod/vize#13167 ·
I maintainer di solito rispondono entro 1 giorno
-
area:ui enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
transit-audio/transit#738 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 91/100
hocinehacherouf/liberarr#78 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno