fix(frontend): simplify asciinema regex

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-02-06 12:11:51 +01:00
parent 215ceea72c
commit 3f8771a15e
2 changed files with 7 additions and 8 deletions

View file

@ -25,6 +25,12 @@ describe('Replace asciinema link', () => {
)
})
it('will replace a valid URL with appendix', () => {
expect(markdownIt.renderInline('https://asciinema.org/a/123981234?a=1')).toBe(
`<app-asciinema id='123981234'></app-asciinema>`
)
})
it("won't replace an URL without path", () => {
expect(markdownIt.renderInline('https://asciinema.org/123981234')).toBe(`https://asciinema.org/123981234`)
})