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

Fenced blocks marked with language are stripped out #1428

Open
stevage opened this issue Nov 10, 2021 · 2 comments
Open

Fenced blocks marked with language are stripped out #1428

stevage opened this issue Nov 10, 2021 · 2 comments

Comments

@stevage
Copy link

stevage commented Nov 10, 2021

Input code (as a markdown file referenced from documentation.yml):

(I added \ at the start of ``` lines to get Github Issues to leave them alone).

 To use without any build process:
 
\```html 
<script src="https://unpkg.com/map-gl-utils"></script> 
\``` 
 
then 
 
\```js 
U.init(map) 
\```

Output documentation:

<p>To use without any build process:</p>
<p>then</p>
<p>With Webpack etc:</p>

Expected: either just a regular code block, or ideally, with different syntax highlighting for js/html

Actual: those code blocks are completely missing from output.

Version 13.2.5

Running on CLI: documentation build -f html -o docs --config documentation.yml --sort-order alpha src/index.js src/utilsGenerated.js

https://github.com/stevage/map-gl-utils/blob/master/package.json#L16

For context: I want the language markers because the same README is also published to NPM and Github.

@rolandpoulter
Copy link

I think this is the same, issue I am having. I can't put any code blocks in with a language. They work if no language is specified but that is not ideal. I'd like the documentation to support highlighting syntax on code blocks. Maybe I am misconfiguring it.

@rolandpoulter
Copy link

The issue is a combination of how highlighter.js calls hljs.highlightAuto and more critically because remark html is not configured with sanitaze: false, and clean: false

https://gitlab.com/seaturtle.dev/documentationjs-theme/-/commit/0acf21e37385e1358c54ae9839706a2fddd35b20

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

No branches or pull requests

2 participants