Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rst header with trailing space after name not recognized #4280

Closed
rpuntaie opened this issue Jan 20, 2018 · 4 comments
Closed

rst header with trailing space after name not recognized #4280

rpuntaie opened this issue Jan 20, 2018 · 4 comments

Comments

@rpuntaie
Copy link

Pandoc 2.1.1

In this example

=====================
Software Requirements
=====================

------
Device
------

Requirements - Functionality
============================

Installer
---------

Driver 
------

About driver

converted to docx with

pandoc -f rst -t docx tmp.rest -o "tmp.docx"

I get

Driver ------

but not a

Driver

with header formating.

This is a rst reader problem because towards HTML

pandoc -f rst tmp.rest

I get the same:

<h1 id="software-requirements">Software Requirements</h1>
<h2 id="device">Device</h2>
<h3 id="requirements---functionality">Requirements - Functionality</h3>
<h4 id="installer">Installer</h4>
<p>Driver ------</p>
<p>About driver</p>
@jkr
Copy link
Collaborator

jkr commented Jan 20, 2018

I can't reproduce (with pandoc 2.1.1 or 2.0.6)

$ cat tmp.rest      
=====================
Software Requirements
=====================

------
Device
------

Requirements - Functionality
============================

Installer
---------

Driver
------

About driver
$ pandoc -f rst tmp.rest
<h1 id="software-requirements">Software Requirements</h1>
<h2 id="device">Device</h2>
<h3 id="requirements---functionality">Requirements - Functionality</h3>
<h4 id="installer">Installer</h4>
<h4 id="driver">Driver</h4>
<p>About driver</p>

Maybe it has something to do with your line endings? What OS are you using?

@jkr
Copy link
Collaborator

jkr commented Jan 20, 2018

Oh, I see -- it has to do with an extra space at the end of "Driver", i.e.
Driver \n------ instead of Driver\n------.

MWE:

$ echo 'Foo \n==='|pandoc -f rst
<p>Foo ===</p>

@jgm -- this is a bug, right? rst2html.py does it correctly.

@jkr jkr changed the title rst header not recognized on seemingly random occasions rst header with trailing space after name not recognized Jan 20, 2018
@rpuntaie
Copy link
Author

Yes, rst2html.py produces the title, even if there is a space after Driver.

@jgm
Copy link
Owner

jgm commented Jan 20, 2018

Proper test case is

echo -e 'Foo \n==='|pandoc -f rst

and actually I DO get a header with this for pandoc 1.19.2.1, but not for 2.x.
So, apparently it's a regression? I tracked it down to f4bff5d where for some reason I replaced a blankline with newline.

Will fix immediately.

@jgm jgm closed this as completed in 957c0e1 Jan 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants