Readd legacy pdf short code markdown it plugin (#1023)

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
Tilman Vatteroth 2021-02-08 20:03:49 +01:00 committed by GitHub
parent 5b1940f0ba
commit 47f5e7653b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,20 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
describe('Short code', () => {
beforeEach(() => {
cy.visitTestEditor()
})
describe('for pdfs', () => {
it('renders a plain link', () => {
cy.codemirrorFill(`{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}`)
cy.getMarkdownBody()
.find('a')
.should('have.attr', 'href', 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf')
})
})
})

View file

@ -23,6 +23,7 @@ import { VimeoReplacer } from '../replace-components/vimeo/vimeo-replacer'
import { YoutubeReplacer } from '../replace-components/youtube/youtube-replacer'
import { BasicMarkdownItConfigurator } from './BasicMarkdownItConfigurator'
import { quoteExtraColor } from '../markdown-it-plugins/quote-extra-color'
import { legacyPdfShortCode } from '../regex-plugins/replace-legacy-pdf-short-code'
export class FullMarkdownItConfigurator extends BasicMarkdownItConfigurator {
constructor(
@ -54,6 +55,7 @@ export class FullMarkdownItConfigurator extends BasicMarkdownItConfigurator {
YoutubeReplacer.markdownItPlugin,
VimeoReplacer.markdownItPlugin,
GistReplacer.markdownItPlugin,
legacyPdfShortCode,
legacySlideshareShortCode,
legacySpeakerdeckShortCode,
AsciinemaReplacer.markdownItPlugin,