We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac90759 commit 790885aCopy full SHA for 790885a
src/plugins/rehype/external-links.ts
@@ -1,9 +1,19 @@
1
import rehypeExternalLinks, { type Options } from "rehype-external-links";
2
3
export const rehypeExternalLinksOptions = {
4
- content: {
5
- type: "text",
6
- value: " ↗",
+ content: (element) => {
+ if (
+ element.children.length === 1 &&
7
+ element.children[0].type === "element" &&
8
+ element.children[0].tagName === "img"
9
+ ) {
10
+ return;
11
+ }
12
+
13
+ return {
14
+ type: "text",
15
+ value: " ↗",
16
+ };
17
},
18
contentProperties: {
19
class: "external-link",
0 commit comments