Closed fregante closed 3 years ago
We linkify full URLs in every piece of code, for example:
<a href="https://fregante.com">
But we don't linkify relative URLs because they're harder to detect and sometimes we can't really resolve them.
I think however that we could detect some URLs, for example in Markdown files:
![Logo](./logo.png) [Contribute](./docs/contributing/) [Cool stuff][demo-url] [demo-url]: ./demo/
Example URL: https://github.com/fregante/ghosttext.fregante.com/commit/a8f1666a7f1e65c2e62764b933e86f769ffabe1d#diff-ab203343d005bd9ca2666791f127c15b798285a9e579edcb628b3be27caa9305R59
The linkifier part would be a function in dom-formatters.ts and would need to have tests.
dom-formatters.ts
This feature might be a little difficult to implement. Maybe you can query .pl-e and parse the textNode that immediately follows instead of parsing everything
.pl-e
Probably too much trouble, we'd have to parse markdown for something relatively rare.
We linkify full URLs in every piece of code, for example:
But we don't linkify relative URLs because they're harder to detect and sometimes we can't really resolve them.
I think however that we could detect some URLs, for example in Markdown files:
Example URL: https://github.com/fregante/ghosttext.fregante.com/commit/a8f1666a7f1e65c2e62764b933e86f769ffabe1d#diff-ab203343d005bd9ca2666791f127c15b798285a9e579edcb628b3be27caa9305R59
The linkifier part would be a function in
dom-formatters.ts
and would need to have tests.This feature might be a little difficult to implement. Maybe you can query
.pl-e
and parse the textNode that immediately follows instead of parsing everything