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
0f3a1461
Commit
0f3a1461
authored
Oct 07, 2016
by
noraiz-anwar
Committed by
GitHub
Oct 07, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13551 from noraiz-anwar/na/mathjax-fix
Fix mathjax rendering
parents
07caef95
34ab38d7
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 @
0f3a1461
...
@@ -384,10 +384,9 @@
...
@@ -384,10 +384,9 @@
}
else
if
(
RE_DISPLAYMATH
.
test
(
htmlString
))
{
}
else
if
(
RE_DISPLAYMATH
.
test
(
htmlString
))
{
htmlString
=
htmlString
.
replace
(
RE_DISPLAYMATH
,
function
(
$0
,
$1
,
$2
,
$3
)
{
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
+
processor
(
'$$'
+
$2
+
'$$'
,
'display'
);
processedHtmlString
=
$1
+
processedHtmlString
;
return
$3
;
return
$3
;
});
});
}
else
{
}
else
{
...
...
common/test/acceptance/pages/lms/discussion.py
View file @
0f3a1461
...
@@ -758,3 +758,11 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin):
...
@@ -758,3 +758,11 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin):
"""
"""
self
.
wait_for_element_visibility
(
".wmd-preview > *"
,
"WMD preview pane has contents"
,
timeout
=
10
)
self
.
wait_for_element_visibility
(
".wmd-preview > *"
,
"WMD preview pane has contents"
,
timeout
=
10
)
return
self
.
q
(
css
=
".wmd-preview"
)
.
html
[
0
]
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 @
0f3a1461
...
@@ -959,6 +959,22 @@ class DiscussionEditorPreviewTest(UniqueCourseTest):
...
@@ -959,6 +959,22 @@ class DiscussionEditorPreviewTest(UniqueCourseTest):
"</ul>"
"</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
)
@attr
(
shard
=
2
)
class
InlineDiscussionTest
(
UniqueCourseTest
,
DiscussionResponsePaginationTestMixin
):
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