-
Notifications
You must be signed in to change notification settings - Fork 1
escaping, headings #2
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
base: master
Are you sure you want to change the base?
Conversation
urshofer
commented
Nov 9, 2017
- Added a levelStyle Option to dynamically change the styles of headings. Sometimes, the default values need to be changed.
- Changed escaping a little bit to reduce latex bugs
- Surrounding square brackets with curly brackets, improving compatibility - Adding Curly Brackets after commands, otherwise a space would be required after the command.
merge master back in
dynamically change styles for headings - sometimes it's very useful to define which latex code to use. see updated docs.
added levelStyles Documentation
Corrected Substitution Order
|
Corrected substitution order in escape function |
removed conflict between curly brackets and \backslash{} command
MD should actually split on newlines, but if you enter manual \\'s, they need to be escaped
and parsing the stuff with the escaper function, seems to be more compatible
makes it compatible with raggedright
makes'em breakable, but respects multiples of them, even on new lines
|
Hi @urshofer, First of all, sorry for not replying you earlier. I haven't been active in GitHub recently. Thank you for your contributions. You have found so many bugs and I feel stupid for my lack of sight. I would gratefully welcome these bug fixes. However, I don't think we should add the option on heading levels. I'm sorry, but I don't feel like it's a generic requirement. I think the best way to do what you need to achieve is this: const marked = require('marked');
const TexRenderer = require('marked-tex-renderer');
let renderer = new TexRenderer();
const oldHeadingRenderer = renderer.heading.bind(renderer);
renderer.heading = function (text, level, row) {
if (level === ...) {
// check the level and return whatever that's necessary
}
return oldHeadingRenderer(text, level, row);
};I would also be thankful to you if you could group related edits (that fixes a single bug), and put them in a temporary feature branch. They would be easier to test and merge. If you don't have time for this, with your permission I would like to copy your fixes to this project. Thank you. Regards. |
|
Hi @sampathsris You can totally copy my code - I'm very sorry not to be able to contribute in a more git-ish style, I'm quite busy right now... |
Same behaviour as Link or Image Implementations
supporting || for splitting a text into a toc and a header part like: in the header||in the toc