fix anchor links in wysiwyg (#14950)

* fix anchor links in wysiwyg
This commit is contained in:
Barbara Valdez
2021-04-08 10:56:11 -07:00
committed by GitHub
parent 35e1daa6ba
commit 4f67f32262
3 changed files with 48 additions and 14 deletions

View File

@@ -143,6 +143,12 @@ suite('HTML Markdown Converter', function (): void {
assert.equal(htmlMarkdownConverter.convert(htmlString), '[msft](http://www.microsoft.com/images/msft.png)', 'Basic http link test failed');
htmlString = 'Test <a href="http://www.microsoft.com/images/msft.png">msft</a>';
assert.equal(htmlMarkdownConverter.convert(htmlString), 'Test [msft](http://www.microsoft.com/images/msft.png)', 'Basic http link + text test failed');
htmlString = '<a href="#hello">hello</a>';
assert.equal(htmlMarkdownConverter.convert(htmlString), '[hello](#hello)', 'Basic link to a section failed');
htmlString = '<a href="file.md#hello">hello</a>';
assert.equal(htmlMarkdownConverter.convert(htmlString), `[hello](.${path.sep}file.md#hello)`, 'Basic anchor link to a section failed');
htmlString = '<a href="http://www.microsoft.com/images/msft.png#Hello">hello</a>';
assert.equal(htmlMarkdownConverter.convert(htmlString), '[hello](http://www.microsoft.com/images/msft.png#Hello)', 'Http link containing # sign failed');
});
test('Should transform <li> tags', () => {