Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
04671392
Commit
04671392
authored
Oct 16, 2014
by
RawKStar77
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explanatory comments.
parent
59cc23ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
markdown.coffee
h/static/scripts/directives/markdown.coffee
+18
-0
No files found.
h/static/scripts/directives/markdown.coffee
View file @
04671392
...
...
@@ -317,6 +317,24 @@ markdown = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitize, $sc
indexes = (match while match = re.exec(value))
indexes.push(value.length)
###
XXX
Hacky
stuff
:
Our
markdown
converter
removes
backslashes
causing
problems
for
certain
types
of
math
.
To
address
this
we
split
the
input
up
on
math
delimiters
,
and
now
don
't
run the math through our markdown converter. This works great for blockmath but inline math
causes some difficulties. While the code below works for most things, there are a few edge
cases such as use of math within block quotes or lists that cause the output to look weird.
This is because the input to the markdown convert is getting split up in ways that do not
reflect how the text should actually be rendered.
For example:
* We can use inline math like this
\(
1+1=2
\)
see!
Renders as:
<ul>
<li>We can use inline math like this </li>
<span class="katex">MATH</span>see!<p></p></ul>
###
for match in indexes
if startMath > endMath
endMath = match.index + match.toString().length
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment