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.
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
efcf78a4f3
Коммит
94b4aa082c
@@ -11,7 +11,7 @@ describe('TextFormatting.Hashtags', function() {
|
|||||||
it('Not hashtags', function(done) {
|
it('Not hashtags', function(done) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
TextFormatting.formatText('# hashtag').trim(),
|
TextFormatting.formatText('# hashtag').trim(),
|
||||||
'<h1 id="hashtag" class="markdown__heading">hashtag</h1>'
|
'<h1 class="markdown__heading">hashtag</h1>'
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.equal(
|
assert.equal(
|
||||||
|
|||||||
@@ -156,9 +156,8 @@ class MattermostMarkdownRenderer extends marked.Renderer {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
heading(text, level, raw) {
|
heading(text, level) {
|
||||||
const id = `${this.options.headerPrefix}${raw.toLowerCase().replace(/[^\w]+/g, '-')}`;
|
return `<h${level} class="markdown__heading">${text}</h${level}>`;
|
||||||
return `<h${level} id="${id}" class="markdown__heading">${text}</h${level}>`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
link(href, title, text) {
|
link(href, title, text) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user