Open albertyckwok opened 4 years ago
That's controlled by the internal library used for syntax highlighting called Prism. Probably this plugin could help with configuring that aspect of it.
Thanks @simov, Do you know if it is possible to imbed JavaScript code in MK. According to the link, I need to put the following code in but it didn't seem to work.
<script type="text/javascript">
// Optional
Prism.plugins.NormalizeWhitespace.setDefaults({
'tabs-to-spaces': 4,
});
</script>
First you need to include the plugin with a <script>
tag I think, because it's not part of what I have bundled with Prism.
For example see how I'm including MathJax in the content script. So in your case it have to be:
dom.push(m('script', {
src: 'https://the-prism-plugin.js'
}))
dom.push(m('script', `
Prism.plugins.NormalizeWhitespace.setDefaults({
'tabs-to-spaces': 4,
});
`))
And then you have to load the extension from your local fork instead.
Of course I can't tell with 100% certainty that it is going to work, but worth a try.
Thanks @simov, I will look into forking the code. I am setting vim with expandtab so that my team mates don't have to load my forked plugging.
The tab character is render as 4 spaces instead of 8. Here is the test code block:
The following how it is rendered:
The expect the result is:
Thanks very much in advance Albert