-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update development branch with some changes #187
Conversation
try { | ||
const val = hljs.highlight(lang, str, true).value; | ||
return `<pre class="hljs"><code>${val}</code></pre>`; | ||
} catch (__) { return ''; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand what is this catch statement is trying to do to return a null string. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, should have named __
with error
instead.
But I guess in this case, it is also better to explain what this code is trying to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is meant to catch error! Apologies for this. It has now been changed to error
. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me 👍
@@ -6,7 +6,7 @@ | |||
</template> | |||
|
|||
<script> | |||
import wrapper from '../../logic/wrapper'; | |||
import wrapper from '../../logic/documentPackager'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiayingy Should have used
import wrapper from 'src/logic/...'
next time
Since our webpack is configured to resolve src
automatically
try { | ||
const val = hljs.highlight(lang, str, true).value; | ||
return `<pre class="hljs"><code>${val}</code></pre>`; | ||
} catch (__) { return ''; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, should have named __
with error
instead.
But I guess in this case, it is also better to explain what this code is trying to do.
|
||
// Getting markdown-it to use plugins | ||
// For KaTeX | ||
md.use(mk); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider using a longer name for mk
. e.g. mdKatex
.
Otherwise, it will be hard to keep track of the plugins when there are many of them in the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted! Has been changed!
whiteList.code.push('class'); | ||
whiteList.span.push('class', 'aria-hidden', 'style', 'role'); | ||
|
||
// New tags not in whiteList that are required by plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed during meeting, maybe we can use of the onIgnoreTag
for future unknown tag included by plugins.
Fixed all issues! Merging! |
Changes include:
variable
fromfilepath
Updates: