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

* Re: reStructuredText: Converting to HTML wraps 'lang' value in tags
  2023-10-03  2:46 reStructuredText: Converting to HTML wraps 'lang' value in tags Ben Hancock
@ 2023-10-04 18:35 ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2023-10-04 18:35 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

That's not a known bug -- but it is clearly a bug.
Could you put up an issue on our GitHub bug tracker, jgm/pandoc?
Thanks!

> On Oct 2, 2023, at 7:46 PM, Ben Hancock <lists-2Dqnj5qYfKrvQC8VwISyQA@public.gmane.org> wrote:
> 
> 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
> 
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/20231002194658.6950c944%40shasta.


^ 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).