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

graves inside a second-level heading render incorrectly #4

Closed
steveklabnik opened this issue Jul 17, 2015 · 5 comments
Closed

graves inside a second-level heading render incorrectly #4

steveklabnik opened this issue Jul 17, 2015 · 5 comments

Comments

@steveklabnik
Copy link
Contributor

Put this in a file named test.md:

test
====

## this title `will render` strangely

This is the body text.

Then run this:

$ marked-man test.md > test.1
$ man ./test.1 

On my system, I get this:

2015-07-17-195339_469x66_scrot

note that strangely is missing the highlight.

.SH this title \fBwill render\fR strangely

this is the text output, but I'm kind bad at troff, so I think that \fR ends the formatting, but this is impossible to google, so hopefully you know :)

One solution is to just pitch anything in graves in a title: they're not being shown any differently anyway.

@steveklabnik
Copy link
Contributor Author

Oh, this is affecting npm: npm/npm#8984 (comment)

@steveklabnik
Copy link
Contributor Author

Ah ha!

\fx names a font x. So, here, \fB switches to bold, and \fR switches to 'roman'. \fP switches to 'previous`, and so I would recommend making this example render

.SH this title \fBwill render\fP strangely

which, on my machine, displays correctly, at least. Of course, .SH is already bold, it seems, so just not even showing anything differently might work. Another option:

.SH this title \fIwill render\fP strangely

This renders like this:
2015-07-17-200522_292x46_scrot

@steveklabnik
Copy link
Contributor Author

Actually https://www.gnu.org/software/groff/manual/html_node/Font-Families.html

Note that \FP doesn’t work; it selects font family ‘P’ instead.

So the right thing is

If no argument is given, switch back to the previous font family.

But using just \f seems to render wrong on my machine.

steveklabnik added a commit to steveklabnik/marked-man that referenced this issue Jul 18, 2015
\fR switches to the roman font, making this only work if the font
was previously roman. With \fP, it switches to the previous font,
working in both headlines as well as regular paragraph text.

Fixes kapouer#4
@kapouer
Copy link
Owner

kapouer commented Jul 18, 2015

Thank you ! i've added a test case - and now i'm fixing the tests, comparing man output without formatting is too relaxed and doesn't test this issue.

@steveklabnik
Copy link
Contributor Author

🎊 Thanks so much!

steveklabnik added a commit to steveklabnik/npm that referenced this issue Jul 18, 2015
This includes a bugfix, kapouer/marked-man#4 ,
which

Fixes npm#8984
iarna pushed a commit to npm/npm that referenced this issue Jul 23, 2015
This includes a bugfix, kapouer/marked-man#4 ,
which

Fixes #8984

PR-URL: #8990
zkat pushed a commit to npm/npm that referenced this issue Jul 24, 2015
This includes a bugfix, kapouer/marked-man#4 ,
which

Fixes #8984

PR-URL: #8990
iarna pushed a commit to npm/npm that referenced this issue Jul 24, 2015
This includes a bugfix, kapouer/marked-man#4 ,
which

Fixes #8984

PR-URL: #8990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants