`dir: rtl` isn't written to `<html>` in HTML output
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Read crates/quarto-core/src/template.rs, especially the two <html> templates at lines 145 and 259. Render the provided dir: rtl example and inspect the generated <html> tag. Done means both templates include the document direction when set, and the rendered tag contains dir="rtl".
由索引模型根据 Issue 内容生成。
描述
This issue was written by Claude while adding q2 support to Great Docs. The output shown comes from running each repro.
Bug description
A document's dir option sets the text direction. Quarto 1 writes it on the root element as
dir="rtl". q2 accepts the option and Lua filters see it in meta.dir, but the HTML templates
don't write it: crates/quarto-core/src/template.rs:145 and :259 are
<html$if(lang)$ lang="$lang$"$endif$>. So Arabic, Hebrew, Persian and Urdu pages render
left-to-right.
Great Docs sets dir: rtl for sites in those languages. Under q2, Great Docs' filter records the
direction in a <meta> tag, and a post-render script adds it to <html>.
Steps to reproduce
mkdir rtl && cd rtl
printf -- '---\ntitle: RTL\nlang: ar\ndir: rtl\n---\n\nمرحبا\n' > index.qmd
q2 render index.qmd
grep -o '<html[^>]*>' index.html
Actual behavior
<html lang="ar">
Expected behavior
As in Quarto 1.9.37:
<html xmlns="http://www.w3.org/1999/xhtml" lang="ar" xml:lang="ar" dir="rtl">
The dir attribute is the part that matters. Adding $if(dir)$ dir="$dir$"$endif$ to both
templates' <html> tags would do it, as in Pandoc's HTML5 template.
- 主要语言
- Rust
- 星标
- 302
- 派生
- 22
- 平均合并
- 5 小时 2 分钟
- 30 天内合并 PR
- 213
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/q2 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
quarto-dev/q2#1188 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
quarto-dev/q2#1179 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
quarto-dev/q2#1133 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
quarto-dev/q2#1103 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
quarto-dev/q2#1095 ·
维护者通常 1 天内回复
相似的 Issue
-
Selected chart highlights only its values, not its series names and category labels可能已有人在做 @Higgs32584 今天认领。 未关闭bug priority: low ui
难度 2/5 1-3 小时 新手友好度 82/100
storytold/gridcraft#4390 · 2 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
bug bugfix priority: medium
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 65/100
BurntSushi/jiff#713 ·
维护者通常 1 天内回复