feat(links.ts): custom identifiers for custom icons #1654
+47
−22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
{ I am pathologically incapable of rebasing, apparently -- #1653 }
This feature gives site authors more control over how links are displayed. You can define a regex that, on match, will auto-append either a string of your choice (so, an emoji) or a Hast element such as a vector path or an image to the link in the rendered HTML.
As an example, I have a substitution:
Which for
![image](https://private-user-images.githubusercontent.com/59982409/395990294-580e0f47-245d-4fa6-9e57-04dfd861cc50.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzQ2MDEwOTQsIm5iZiI6MTczNDYwMDc5NCwicGF0aCI6Ii81OTk4MjQwOS8zOTU5OTAyOTQtNTgwZTBmNDctMjQ1ZC00ZmE2LTllNTctMDRkZmQ4NjFjYzUwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMjE5VDA5MzMxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVhOTQ2YWExMzdhOGI5ZDNlMTBmNTdjNWM4NjkwMjUxZWZkNTcyZjBiMmMxY2QxZWMwOWU0NjZiNGFkZmRhZjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.PZWXEm8Sk27mARRXkynx4A3-TUjXgodCE2qcB-Dm8zI)
[Quartz](Qx!https://quartz.jzhao.xyz)
yields:which links to the correct website as specified in the capturing group.
changes:
Image
,Path
, orEmoji