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

option to disable language autodetect #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

arystan-sw
Copy link

My use case required this option, so I added it. Test included.

it('should not guess the language when autodetect is false', () => {
const markdown = '```.test { height: 1em; }```';
const wrapper = mount(mdToReact(markdown), { autodetect: false });
assert.ok(wrapper.find('code').hasClass('hljs') && wrapper.find('code').hasClass('css'));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could be wrong about this... but isn't this test case the same as the one on line 31 for when it should guess the language? Shouldn't this be different?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, that test was broken. I fixed it.

@tremby
Copy link

tremby commented Nov 3, 2020

I'm using this patch; seems to work well.

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.

4 participants