Skip to content

Conversation

@urshofer
Copy link
Contributor

@urshofer 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.
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
@urshofer
Copy link
Contributor Author

urshofer commented Nov 9, 2017

Corrected substitution order in escape function

@sampathsris
Copy link
Owner

sampathsris commented May 7, 2018

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.

@urshofer
Copy link
Contributor Author

urshofer commented May 7, 2018

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

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

Successfully merging this pull request may close these issues.

2 participants