hackmdio / codimd

CodiMD - Realtime collaborative markdown notes on all platforms.
https://hackmd.io/c/codimd-documentation
GNU Affero General Public License v3.0
9.33k stars 1.06k forks source link

Insert additional separators to the HTML title if the 1st level heading contains raw line breaks `<br>` #749

Open brlin-tw opened 6 years ago

brlin-tw commented 6 years ago

Issue Demonstration Screenshot

Rationale

It is possible to insert line breaks in 1st level headings by exploiting the <br> tag, however this generates ugly HTML title as the line break isn't represented. Please support inserting additional separators like `, - or | ` where the line breaks are available to make it less uglier.

Bonus

Allow user to decide the behavior and separator pattern via note metadata.

Additional Information

This also includes Book Mode and Slide Mode, which is HackMD EE features.

ccoenen commented 6 years ago

I'm not sure I understand your suggestion?

You can use <br> in headlines (see https://hackmd.io/MwDgjATAJlAMCmBaArLCBjRAWVSCc88eiMwwEAbAEYCGAZulFkA= ), and it is shown correctly in the document view and in the slides. What am I missing?

brlin-tw commented 6 years ago

Sorry for the delay, I've updated the screenshot to made it more clear.

ccoenen commented 6 years ago

completely my fault, I missed "html title". Yes, this is indeed not ideal.

SISheogorath commented 6 years ago

If someone wants to play with this but has no idea where to start:

https://github.com/hackmdio/codimd/blob/b1d1f469de7d5df8b58c9dee94b23c1cf7527b91/lib/models/note.js#L286-L296

This should fix it.

dazz commented 6 years ago

@Lin-Buo-Ren You can set the title in the yaml header, separate from the H1 of the slide see https://github.com/hackmdio/codimd/wiki/Slide-Options#basic-yaml-header

---
title: Example Slide
tags: presentation
---