Skip to content

Commit 4df6030

Browse files
comments
1 parent ca3eb75 commit 4df6030

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

mfr/extensions/md/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To add a new library, you need to make sure its loadable in md.js somehow, eithe
2727

2828
Libraries should try to use the same version as the ones used on the OSF. The plugins do not matter as much, but `markdown-it` and `Mathjax` you should try to match exactly because styling can change between versions.
2929

30-
To add a new library that is not already set up to export to `root` can be a bit tricky, but the gist of it is, wrap the plugin in this code:
30+
To add a new library that is not already set up to export to `root` can be a bit tricky but the gist of it is, wrap the plugin in this code:
3131

3232
```javascript
3333
;(function (root, factory) {
@@ -49,4 +49,4 @@ To add a new library that is not already set up to export to `root` can be a bit
4949

5050
And then modify it to work in this context. See other plugins for examples.
5151

52-
Then, in md.js, you can add a plugin to the markdown renderer by adding a `.use(<window.<PLUGIN_NAME>)` after loading the file into `viewer.mako`
52+
Then in md.js, you can add a plugin to the markdown renderer by adding a `.use(window.<PLUGIN_NAME>)` after loading the file into `viewer.mako`.

mfr/extensions/md/render.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def __init__(self, *args, **kwargs):
1919
def render(self):
2020
"""Render a markdown file to html."""
2121
with open(self.file_path, 'r') as fp:
22-
# Bleach will bug out on unclosed tags. OSF wiki does not. This is
23-
# Due to versioning problems: https://github.com/mozilla/bleach/issues/271
22+
# Bleach will bug out on unclosed tags. OSF wiki does not have this issue.
23+
# This is due to versioning problems: https://github.com/mozilla/bleach/issues/271
2424
body = bleach.clean(fp.read(), **BLEACH_WHITELIST)
2525
return self.TEMPLATE.render(base=self.assets_url, body=body)
2626

mfr/extensions/md/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# This list comes from the OSF
12
BLEACH_WHITELIST = {
23
'tags': [
34
'a', 'abbr', 'acronym', 'b', 'bdo', 'big', 'blockquote', 'br',

mfr/extensions/md/static/js/md.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ var markdown = new MarkdownIt('commonmark', {
1919
.disable('strikethrough');
2020

2121

22-
document.getElementById("jaxified").innerHTML = markdown.render(document.getElementById("jaxified").innerHTML);
22+
document.getElementById("jaxified").innerHTML = markdown.render(document.getElementById("jaxified").innerHTML);

0 commit comments

Comments
 (0)