Skip to content
Merged
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
6 changes: 5 additions & 1 deletion docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,14 @@ separated by an equal sign `=`. Options are separated by spaces. Options can be
used to modify the behaviour of markup tags, for example changing the target of
a link.

<mf2-interactive>

```mf2
This is a {#link to="home"}link{/link}.
This is a {#link to=|https://example.com|}link{/link}.
```

</mf2-interactive>

It is best practice to not mix styles into messages too much - instead, use
markup tags to add semantic meaning and selectors to text, and let the
application decide how to render the message. This makes it easier to change the
Expand Down
2 changes: 1 addition & 1 deletion playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export default function IndexPage({ comp }: any) {
<code>link</code>
</td>
<td class="border px-2">
Add a link, pointing to the <code>url</code> option.
Add a link, pointing to the <code>to</code> option.
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion src/_utils/message_format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function formatMessageToHTML(
}
case "link": {
const link = document.createElement("a");
link.href = part.options?.url as string;
link.href = part.options?.to as string;
link.target = "_blank";
link.rel = "noopener noreferrer";
currentElement.appendChild(link);
Expand Down