Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add definition for plain text #1800

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 22 additions & 1 deletion 10.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,27 @@ When replying to a text event E the reply event's "p" tags should contain all of
Example: Given a text event authored by `a1` with "p" tags [`p1`, `p2`, `p3`] then the "p" tags of the reply should be [`a1`, `p1`, `p2`, `p3`]
in no particular order.

## Plain text

"Plain text" content is distinguished from content that requires parsing in order to be human-readable. Plain text MAY have some light formatting (as defined below), as long as it can be naturally read by humans as written. Client MAY parse and display notes to improve the aesthetic of displayed content.

The litmus test for formatting admissible in "plain text" content is whether such syntax would naturally be used by non-technical users with no expectation of parsing or rendering. Users themselves MAY include any formatting they choose, but for the sake of simplicity formatting implemented _by clients_ MUST be limited to the following:

- A `>` at the beginning of a line MAY be used to indicate quotations
- A `#` at the beginning of a word MAY be used to indicate a topic and SHOULD have a corresponding `t` tag
- A `$` at the beginning of a word MAY be used to indicate a stock ticker
- Matched `*` characters within a single line MAY be used to indicate emphasis
- Matched `:` characters around a single word MAY be used to indicate emojis (see [NIP 30](./30.md))
- Single-backticks with no language tag MAY be used for inline code blocks
- Triple-backticks with no language tag MAY be used for multi-line code blocks
- Unordered lists MUST be one level deep, contain only one line, and SHOULD use the `-` character
- Ordered lists MUST be one level deep, contain only one line, and MUST be sequentially numbered
- URLs (including [NIP 27](./27.md) references, and [NIP 73](./73.md) identifiers, excluding base64 image data and `nembed`s)

Note that code blocks are only admissible because they are useful for opting-out of any default parsing clients may do.

Clients MAY render urls as cards, images, audio players, etc, but SHOULD render domain names without schema or path (e.g. `nytimes.com`) as text.

## Deprecated Positional "e" tags

This scheme is not in common use anymore and is here just to keep backward compatibility with older events on the network.
Expand Down Expand Up @@ -81,4 +102,4 @@ Where:

* Many "e" tags: `["e", <root-id>]` `["e", <mention-id>]`, ..., `["e", <reply-id>]`<br>
There may be any number of `<mention-ids>`. These are the ids of events which may, or may not be in the reply chain.
They are citing from this event. `root-id` and `reply-id` are as above.
They are citing from this event. `root-id` and `reply-id` are as above.
2 changes: 1 addition & 1 deletion 22.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Comment

A comment is a threading note always scoped to a root event or an [`I`-tag](73.md).

It uses `kind:1111` with plaintext `.content` (no HTML, Markdown, or other formatting).
It uses `kind:1111` with [plaintext](./10.md#plain-text) `.content` (no HTML, Markdown, or other formatting).

Comments MUST point to the root scope using uppercase tag names (e.g. `K`, `E`, `A` or `I`)
and MUST point to the parent item with lowercase ones (e.g. `k`, `e`, `a` or `i`).
Expand Down