Open eritbh opened 5 years ago
I would suggest to use |
as delimiter as it's seldom used in comments/posts.
And for templating, I'd suggest to mix two chars for start and finish, or use them twice.
{$ thing here $}
{% thing here %}
{{ thing here }} <-- I prefer this one
This is so you can use the characters in the comments without running into issues so easily. And we can make sure people can fix it if they want by escaping
{{select
|I am an \| option
|I'm \{\{ enclosed }}
}}
If we ever introduce parameters for types, we can do something like
{{switch;name:fancyname|Switch label here}}
{{select;typeahead;hidden-by:fancyname|foo|bar|baz}}
Edit: Some more options
{{start-select;option;option2}}
{{start-item}}
I am an | option
{{end-item}}
{{start-item}}
I'm \{\{ enclosed }}
{{end-item}}
{{end-select}}
@start-select(option, option2)
@start-item
I am an | option
@end-item
@start-item
I'm {{ enclosed }}
@end-item
@end-select
Just going over issues at the moment and wanted to note that:
I would suggest to use | as delimiter as it's seldom used in comments/posts.
Probably isn't true as I have seen it used in footers a bunch to put in a bunch of links to stuff like rules, wikis, etc.
Not sure what the best approach here is except possibly building in escape functionality for whatever delimiter character we decide on.
So, instead of doing tokens. Another option would be to keep HTML parsing but utilize web-components (if that's possible).
<input type="text">
~> <tb-text>
<textarea>
~> <tb-text multiline>
<select>
~> <tb-select><tb-option option></tb-option></tb-select>
This means we can
Or will there still be an issue with escaping and whatnot?
Instead of using stuff like
<textarea>
,<select>
,<input>
inside removal reason bodies to get custom text input, we should have tokens that are replaced with the appropriate elements without having to parse HTML. For example:<input type="text">
~>{textfield}
<textarea>
~>{textarea}
<select>
~>{option|other option|etc}
part of #93
things we'll have to do
blocked on #119