Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const changelog =
const emptyPlugins = []
/** @type {Readonly<RemarkRehypeOptions>} */
const emptyRemarkRehypeOptions = {allowDangerousHtml: true}
const safeProtocol = /^(https?|ircs?|mailto|xmpp)$/i
const safeProtocol = /^(https?|ircs?|mailto|tel|xmpp)$/i

// Mutable because we `delete` any time it’s used and a message is sent.
/** @type {ReadonlyArray<Readonly<Deprecation>>} */
Expand Down
7 changes: 7 additions & 0 deletions test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,13 @@ test('Markdown', async function (t) {
)
})

await t.test('should support a tel', function () {
assert.equal(
renderToStaticMarkup(<Markdown children="[](tel:+12345678910)" />),
'<p><a href="tel:+12345678910"></a></p>'
)
})

await t.test('should allow an empty URL', function () {
assert.equal(
renderToStaticMarkup(<Markdown children="[]()" />),
Expand Down