Skip to content
This repository was archived by the owner on Nov 23, 2022. It is now read-only.

Commit 47f5e76

Browse files
authored
Readd legacy pdf short code markdown it plugin (#1023)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
1 parent 5b1940f commit 47f5e76

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
3+
*
4+
* SPDX-License-Identifier: AGPL-3.0-only
5+
*/
6+
7+
describe('Short code', () => {
8+
beforeEach(() => {
9+
cy.visitTestEditor()
10+
})
11+
12+
describe('for pdfs', () => {
13+
it('renders a plain link', () => {
14+
cy.codemirrorFill(`{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}`)
15+
cy.getMarkdownBody()
16+
.find('a')
17+
.should('have.attr', 'href', 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf')
18+
})
19+
})
20+
})

src/components/markdown-renderer/markdown-it-configurator/FullMarkdownItConfigurator.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { VimeoReplacer } from '../replace-components/vimeo/vimeo-replacer'
2323
import { YoutubeReplacer } from '../replace-components/youtube/youtube-replacer'
2424
import { BasicMarkdownItConfigurator } from './BasicMarkdownItConfigurator'
2525
import { quoteExtraColor } from '../markdown-it-plugins/quote-extra-color'
26+
import { legacyPdfShortCode } from '../regex-plugins/replace-legacy-pdf-short-code'
2627

2728
export class FullMarkdownItConfigurator extends BasicMarkdownItConfigurator {
2829
constructor(
@@ -54,6 +55,7 @@ export class FullMarkdownItConfigurator extends BasicMarkdownItConfigurator {
5455
YoutubeReplacer.markdownItPlugin,
5556
VimeoReplacer.markdownItPlugin,
5657
GistReplacer.markdownItPlugin,
58+
legacyPdfShortCode,
5759
legacySlideshareShortCode,
5860
legacySpeakerdeckShortCode,
5961
AsciinemaReplacer.markdownItPlugin,

0 commit comments

Comments
 (0)