`dir: rtl` isn't written to `<html>` in HTML output

Abierto Apto para principiantes
#1,219 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust
Área
backend

Línea de trabajo

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".

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
302
Forks
22
Merge medio
5 h 2 min
PR fusionados (30 d)
213

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de quarto-dev/q2

Todos los issues de quarto-dev/q2

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.