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

Markdown fixes #321

Merged
merged 4 commits into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/markdown-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* limitations under the License.
*/
import { Renderer } from 'marked';
import { escape } from 'marked/src/helpers';
import Prism from 'prismjs';

export function createRenderer() {
Expand All @@ -24,7 +25,9 @@ export function createRenderer() {
}
if (!infostring || infostring.length <= 0) {
return `
<pre class="language-text"><code class="language-text">${code}</code></pre>`;
<pre class="language-text"><code class="language-text">${escape(
code,
)}</code></pre>`;
}
if (!(infostring in Prism.languages)) {
throw Error(`Unsupported language "${infostring}"`);
Expand Down