Escaping in gemtext

mbays at sdf.org mbays at sdf.org
Tue Nov 10 16:17:29 GMT 2020


Here's a possible solution to the problem of escapes which I don't think 
has been mentioned.

Currently each of the line types is introduced by a 1-3 char prefix with 
two exceptions: the default text line type, and the preformatted line 
type. We can deal with the escaping problem by adding prefixes for these 
too. So there's a sense in which this actually makes gemtext *simpler*, 
more regular, even as it adds more notation. As a nice side-effect, it 
also lets one- and two-liner preformatted blocks take less vertical 
space. 

The prefix for text line could be just a backslash, roughly in line with 
the suggestion elsewhere in this thread. Examples:

\#Bold# text is sometimes denoted this way.

\=> HELLO! <=

\* is the multiplication operator

\\n refers to the newline character.

\This is just an ordinary text line, the initial backslash is ignored.


And for preformatted lines, it could e.g. be "`` ":

`` $ make install

`` ```   rain
``  ```   drops

`` `` ... '' she replied, speechless.


That leaves the problem (if we're to be completist) of associating 
alt-text to a sequence of preformatted lines using this notation. We 
could say that such a sequence immediately following a preformatted 
block using "```" is considered part of the block:

``` rain drops
```
`` ```
``  ```

Alternatively (neater?) we could consider "`` " as magic even when it's 
within a preformatted block:

``` rain drops
`` ```
``  ```
```
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20201110/3517c648/attachment.sig>


More information about the Gemini mailing list