summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorVeraLyu <lvroyce0210@gmail.com>2017-03-23 20:19:22 +0800
committerJoram Wilander <jwawilander@gmail.com>2017-03-23 08:19:22 -0400
commit94b4aa082c456914d89d9926d06814bd17309a73 (patch)
treeb0daa725db3cc21727f7bc57475cced7be4f7b82 /webapp
parentefcf78a4f3f2471f3b4350d1e8a4948a15106f6a (diff)
downloadchat-94b4aa082c456914d89d9926d06814bd17309a73.tar.gz
chat-94b4aa082c456914d89d9926d06814bd17309a73.tar.bz2
chat-94b4aa082c456914d89d9926d06814bd17309a73.zip
PLT-5913: Remove id from heading markdown compilation (#5782)
Id for heading markdown is unnecessary as we didn't attach any style/effect on that id, and it also introduce duplicate id. So remove it from heading markdown generatiing.
Diffstat (limited to 'webapp')
-rw-r--r--webapp/tests/formatting_hashtags.test.jsx2
-rw-r--r--webapp/utils/markdown.jsx5
2 files changed, 3 insertions, 4 deletions
diff --git a/webapp/tests/formatting_hashtags.test.jsx b/webapp/tests/formatting_hashtags.test.jsx
index 657dcf69d..cfda9aaa2 100644
--- a/webapp/tests/formatting_hashtags.test.jsx
+++ b/webapp/tests/formatting_hashtags.test.jsx
@@ -11,7 +11,7 @@ describe('TextFormatting.Hashtags', function() {
it('Not hashtags', function(done) {
assert.equal(
TextFormatting.formatText('# hashtag').trim(),
- '<h1 id="hashtag" class="markdown__heading">hashtag</h1>'
+ '<h1 class="markdown__heading">hashtag</h1>'
);
assert.equal(
diff --git a/webapp/utils/markdown.jsx b/webapp/utils/markdown.jsx
index c84df0fa5..db8e739e6 100644
--- a/webapp/utils/markdown.jsx
+++ b/webapp/utils/markdown.jsx
@@ -156,9 +156,8 @@ class MattermostMarkdownRenderer extends marked.Renderer {
return out;
}
- heading(text, level, raw) {
- const id = `${this.options.headerPrefix}${raw.toLowerCase().replace(/[^\w]+/g, '-')}`;
- return `<h${level} id="${id}" class="markdown__heading">${text}</h${level}>`;
+ heading(text, level) {
+ return `<h${level} class="markdown__heading">${text}</h${level}>`;
}
link(href, title, text) {