Skip to content

Commit

Permalink
Merge branch 'main' into feature/DEV-896-sign-up
Browse files Browse the repository at this point in the history
  • Loading branch information
datalek authored Nov 13, 2023
2 parents 43f7627 + 78542f2 commit e958c53
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/nextjs-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"download-docs": "./scripts/fetch-docs.sh b8bfaf829beec5fa62aec06a68ab7b0c77b05332",
"download-docs": "./scripts/fetch-docs.sh 732ab9e",
"compile": "tsc --noEmit",
"dev": "next dev",
"build": "next build",
Expand Down
17 changes: 17 additions & 0 deletions packages/gitbook-docs/src/__tests__/parseContent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -683,4 +683,21 @@ describe('parseContent', () => {
),
]);
});

it('should parse mailto inside links', () => {
expect(
parseContent(
'[[email protected]](mailto:[email protected])',
config
)
).toStrictEqual([
new Markdoc.Tag('Paragraph', {}, [
new Markdoc.Tag(
'Link',
{ href: 'mailto:[email protected]' },
['[email protected]']
),
]),
]);
});
});
3 changes: 2 additions & 1 deletion packages/gitbook-docs/src/markdoc/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export class LinkAttr {
'^http:\\/\\/localhost:5000(\\/o\\/[\\w]*)?\\/s\\/(.*?)\\/?$',
'g'
);
if (value && !value.startsWith('http')) {

if (value && !value.startsWith('http') && !value.startsWith('mailto:')) {
const isIndex = variables?.isPageIndex === true;
const pagePath = isIndex
? variables.pagePath
Expand Down

0 comments on commit e958c53

Please sign in to comment.