Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
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
edx
edx-platform
Commits
34ab38d7
Commit
34ab38d7
authored
Sep 21, 2016
by
Noraiz Anwar
Committed by
Noraiz
Oct 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mathjax rendering
TNL-5451
parent
dda92d13
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
+26
-3
common/static/common/js/discussion/utils.js
+2
-3
common/test/acceptance/pages/lms/discussion.py
+8
-0
common/test/acceptance/tests/discussion/test_discussion.py
+16
-0
No files found.
common/static/common/js/discussion/utils.js
View file @
34ab38d7
...
...
@@ -384,10 +384,9 @@
}
else
if
(
RE_DISPLAYMATH
.
test
(
htmlString
))
{
htmlString
=
htmlString
.
replace
(
RE_DISPLAYMATH
,
function
(
$0
,
$1
,
$2
,
$3
)
{
/*
bug fix, ordering is off
corrected mathjax rendering in preview
*/
processedHtmlString
=
processor
(
'$$'
+
$2
+
'$$'
,
'display'
)
+
processedHtmlString
;
processedHtmlString
=
$1
+
processedHtmlString
;
processedHtmlString
+=
$1
+
processor
(
'$$'
+
$2
+
'$$'
,
'display'
);
return
$3
;
});
}
else
{
...
...
common/test/acceptance/pages/lms/discussion.py
View file @
34ab38d7
...
...
@@ -758,3 +758,11 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin):
"""
self
.
wait_for_element_visibility
(
".wmd-preview > *"
,
"WMD preview pane has contents"
,
timeout
=
10
)
return
self
.
q
(
css
=
".wmd-preview"
)
.
html
[
0
]
def
get_new_post_preview_text
(
self
):
"""
Get the rendered preview of the contents of the Discussions new post editor
Waits for content to appear, as the preview is triggered on debounced/delayed onchange
"""
self
.
wait_for_element_visibility
(
".wmd-preview > div"
,
"WMD preview pane has contents"
,
timeout
=
10
)
return
self
.
q
(
css
=
".wmd-preview"
)
.
text
[
0
]
common/test/acceptance/tests/discussion/test_discussion.py
View file @
34ab38d7
...
...
@@ -959,6 +959,22 @@ class DiscussionEditorPreviewTest(UniqueCourseTest):
"</ul>"
))
def
test_mathjax_rendering_in_order
(
self
):
"""
Tests that mathjax is rendered in proper order.
When user types mathjax expressions into discussion editor, it should render in the proper
order.
"""
self
.
page
.
set_new_post_editor_value
(
'Text line 1
\n
'
'$$e[n]=d_1$$
\n
'
'Text line 2
\n
'
'$$e[n]=d_2$$'
)
self
.
assertEqual
(
self
.
page
.
get_new_post_preview_text
(),
'Text line 1
\n
Text line 2'
)
@attr
(
shard
=
2
)
class
InlineDiscussionTest
(
UniqueCourseTest
,
DiscussionResponsePaginationTestMixin
):
...
...
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