public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* reStructuredText: Converting to HTML wraps 'lang' value in tags
@ 2023-10-03  2:46 Ben Hancock
  2023-10-04 18:35 ` John MacFarlane
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hancock @ 2023-10-03  2:46 UTC (permalink / raw)
  To: Pandoc-List

Hi fellow pandoc users:

I'm converting reStructuredText to HTML using the standalone option,
and finding that setting the 'lang' metadata actually wraps the value
of the field in HTML tags. Here's an example session:

	$ cat test.rst
	===========
	A Test File
	===========

	:Author: Myself
	:lang: en-US

	A Wonderful Chapter
	===================

	In which I expound the virtues of reStructuredText ...

	$ pandoc -s -f rst -t html test.rst | head -n 2
	<!DOCTYPE html>
	<html xmlns="http://www.w3.org/1999/xhtml" lang="<p>en-US</p>" xml:lang="<p>en-US</p>">

	$ pandoc --version
	pandoc 2.14.0.3

Note in particular the `<p>` tags in `lang="<p>en-US</p>" xml:lang="<p>en-US</p>">`.

Nothing appears wrong with the template:

	$ pandoc -D html | head -n 2
	<!DOCTYPE html>
	<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$>

... and Markdown works fine:

	$ cat test.md
	---
	title: A Test File
	lang: en-US
	---

	## A Wonderful Chapter

	In which I expound the virtues of Markdown ...

	$ pandoc -s test.md | head -n 2
	<!DOCTYPE html>
	<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">

Any ideas? Is this a known bug, or have I done something wrong?

Cheers,

- Ben


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-04 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-03  2:46 reStructuredText: Converting to HTML wraps 'lang' value in tags Ben Hancock
2023-10-04 18:35 ` John MacFarlane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).