Skip to content

Formatting

When a post is submitted in plain format, GoToSocial automatically does some tidying up and formatting of the post in order to convert it to HTML, as described below.

Whitespace

Any leading or trailing whitespaces and newlines are removed from the post. So for example:

text


this post starts with some newlines

will become:

text
this post starts with some newlines

Wrapping

The whole post will be wrapped in <p></p>.

So the following text:

text
Hi here's a little post!

Will become:

html
<p>Hi here's a little post!</p>

Linebreaks

Any newlines will be replaced with <br />

So to continue the above example:

text
Hi here's a little post!

And here's another line.

Will become:

html
<p>Hi here's a little post!<br /><br />And here's another line</p>

Any recognizable links in the text will be shortened and turned into proper hyperlinks, and have some additional attributes added to them.

For example:

text
Here's a link to something: https://example.org/some/link/address

will become:

html
Here's a link to something: <a href="https://example.org/some/link/address" rel="nofollow" rel="noreferrer" rel="noopener">example.org/some/link/address</a>

which will be rendered as:

Here's a link to something: example.org/some/link/address

Note that this will only work for http and https links; other schemes are not supported.

Mentions

You can 'mention' another account by referring to the account in the following way:

@some_account@example.org

In this example, some_account is the username of the account you want to mention, and example.org is the domain that hosts their account.

The mentioned account will get a notification that you've mentioned them, and be able to see the post in which they were mentioned.

Mentions are formatted in a similar way to links, so:

text
hi @some_account@example.org how's it going?

will become:

html
hi <span class="h-card"><a href="https://example.org/@some_account" class="u-url mention">@<span>some_account</span></a></span> how's it going?

which will be rendered as:

hi @some_account how's it going?

When mentioning local accounts (ie., accounts on your instance), the second part of the mention is not necessary. If there's an account with username local_account_person on your instance, you can mention them just by writing:

text
hey @local_account_person you're my neighbour

This will become:

html
hey <span class="h-card"><a href="https://my.instance.org/@local_account_person" class="u-url mention">@<span>local_account_person</span></a></span> you're my neighbour

which will be rendered as:

hey @local_account_person you're my neighbour

Hashtags

You can use one or more hashtags in your post to indicate subject matter, and to allow the post to be grouped together with other posts using the same hashtag in order to aid discoverability of your posts.

Most ActivityPub server implementations like Mastodon and similar only group together *Public- posts by the hashtags they use, but there is no guarantee about that. Generally speaking then, it is better to only use hashtags for Public visibility posts where you want the post to be able to spread more widely than it would otherwise. A good example of this is the #introduction hashtag, which tends to be used by new accounts who want to introduce themselves to the fediverse!

Including hashtags in your post works like most other social media software: just add a # symbol before the word you want to use as a hashtag.

Some examples:

  • #introduction
  • #Mosstodon
  • #LichenSubscribe

Hashtags in GoToSocial are case-insensitive, so it doesn't matter if you use uppercase, lowercase, or a mixture of both when writing your hashtag, it will still count as the same hashtag. For example, #Introduction and #introduction are treated exactly the same.

For accessibility reasons, it is considerate to use upper camel case when you're writing hashtags. In other words: capitalize the first letter of every word in the hashtag. So rather than writing #thisisahashtag, which is difficult to read visually, and difficult for screenreaders to read out loud, consider writing #ThisIsAHashtag instead.

You can include as many hashtags as you like within a GoToSocial post, and each hashtag has a length limit of 100 characters.

TIP

To end a hashtag, you can simply use a space, for example in the text this #soup rules, the hashtag is terminated by a space so #soup becomes the hashtag. However, you can also use a pipe character |, or the unicode characters \u200B (zero-width no-break space) or \uFEFF (zero-width space), to create "partial-word" hashtags. For example, with input text this #so|up rules, only the #so part becomes the hashtag. Likewise, with the input text this #so​up rules, which contains an invisible zero-width space after the o and before the u, only the #so part becomes the hashtag. See here for more information on zero-width spaces: https://en.wikipedia.org/wiki/Zero-width_space.