diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-02-01 00:48:18 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2018-02-09 21:13:44 +0300 |
commit | 603fa7c14193d37e3953225501d2108f0c581df5 (patch) | |
tree | bbaa12a41c577dbcb7e4cd1772df7fd2f2156d8e /spec/features/markdown/math_spec.rb | |
parent | 5e9e56924a56dcb84c3ae4ae6fc308f635f39f66 (diff) |
Merge branch 'fix-mermaid-xss' into 'security-10-4'
[10.4] Fix stored XSS in code blocks
Diffstat (limited to 'spec/features/markdown/math_spec.rb')
-rw-r--r-- | spec/features/markdown/math_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/features/markdown/math_spec.rb b/spec/features/markdown/math_spec.rb new file mode 100644 index 00000000000..6a23d6b78ab --- /dev/null +++ b/spec/features/markdown/math_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe 'Math rendering', :js do + it 'renders inline and display math correctly' do + description = <<~MATH + This math is inline $`a^2+b^2=c^2`$. + + This is on a separate line + ```math + a^2+b^2=c^2 + ``` + MATH + + project = create(:project, :public) + issue = create(:issue, project: project, description: description) + + visit project_issue_path(project, issue) + + expect(page).to have_selector('.katex .mord.mathit', text: 'b') + expect(page).to have_selector('.katex-display .mord.mathit', text: 'b') + end +end |