-
-
Couldn't load subscription status.
- Fork 25
Text Formatting Extensions #12
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
base: master
Are you sure you want to change the base?
Conversation
| {STYLE BRACE}(CONTENT BRACE) | ||
| ``` | ||
|
|
||
| The STYLE BRACE contains the formatting options, which are separated by semicolons. The formatting options are key-value pairs, with the key and value separated by a colon. The key is the name of the formatting option, and the value is the value of the formatting option. The key is **case-insensitive**, and the value is **case-sensitive**. The key and value are separated by a colon, and the key-value pairs are separated by semicolons. The key is not allowed to contain any characters other than letters and the spe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the spe,
mistake here i assume
|
|
||
| # Security concerns | ||
|
|
||
| As this RFC does not introduce any new security concerns, there are no security concerns to be addressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing is that (at least web) clients should be careful not to use the colour field verbatim, as it could point to an arbitrary URL (in that case of gradient rendering => it uses background to achieve this).
| STYLE_BRACE ::= "{" STYLE_PAIR "}" | ||
| STYLE_PAIR ::= STYLE_PAIR ";" STYLE_PAIR | STYLE_PAIR | ||
| STYLE_PAIR ::= KEY ":" VALUE | ||
| KEY ::= [a-zA-Z]+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this allow dashes? One of the examples has a dash, i-do-not: exist.
| ```bnf | ||
| STYLE_BRACE ::= "{" STYLE_PAIR "}" | ||
| STYLE_PAIR ::= STYLE_PAIR ";" STYLE_PAIR | STYLE_PAIR | ||
| STYLE_PAIR ::= KEY ":" VALUE | ||
| KEY ::= [a-zA-Z]+ | ||
| VALUE ::= [^;]+ | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to account for the whitespaces here?
{color: red; font: monospace; background: yellow}(red)
^ ^
My current regex looks like this:
/\{([a-zA-Z]+):([^;]+?)(?:;([a-zA-Z]+):([^;]+?))*\}\(/gBased off the spec, but this doesn't match string provided.
For example, one could do:
/\{([a-zA-Z]+):([^;]+?)(?:;\s*([a-zA-Z]+):([^;]+?))*\}\(/gi.e. add any whitespace after ;
|
|
||
| ```markdown | ||
| {} // invalid; the key-value pair is empty and thus redundant | ||
| {color: red; color: blue} // invalid; the key is repeated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing code for clients would probably be simpler if we just allowed repetition?
I am working on a PoC remark plugin and I could detect and throw an error and catch it and whatever, or... I could just override the key I already wrote earlier. Makes for cleaner code for this edge case.
No description provided.