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

How to set "mangle" option if installed globally? #2810

Closed
danielkrajnik opened this issue May 20, 2023 · 2 comments · Fixed by #2937
Closed

How to set "mangle" option if installed globally? #2810

danielkrajnik opened this issue May 20, 2023 · 2 comments · Fixed by #2937
Labels

Comments

@danielkrajnik
Copy link

danielkrajnik commented May 20, 2023

using marked as a globally installed module gives you a warning that asks you to set mangle option to false.

How do you do that? Is there a config file to change such options?

Sorry, if it's a noob question...

@danielkrajnik danielkrajnik changed the title How to configure mangle option if installed globally? How to set "mangle" option if installed globally? May 20, 2023
@danielkrajnik
Copy link
Author

danielkrajnik commented May 20, 2023

Editing marked.js in bin directory based on this piece from the official documentation seemed to have worked and the warnings disappeared, but if someone could please confirm that this is a supported operation and it won't be wiped out on the next update that would be really helpful.

// Set options
marked.use({
  mangle: false,
  headerIds: false,
});

@UziTech
Copy link
Member

UziTech commented May 24, 2023

The easiest way to set defaults is to create an alias alias my_marked='marked --no-mangle --no-heading-ids'

Of you can create a node script that calls marked and create an alias that calls marked alias my_marked='node ~/my_marked.js'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants