Except that as an inclusible HTML fragment, `alert.html` presents an unhiged manner to imitate the above. It has to be included (implying everything is on a same line) and requires two variables to be passed to it, one indicating the type of alert, and the other being one whole string with all the text that needs to be shown. Newlines are not permitted and have to be broken by including `<br>`, not because it means a line break in HTML, but as an arbitrary token that `alert.html` will scan for and use as a breaking point for newlines. This is necessary since Liquid doesn't support initializing arrays, and that arbitrarily chosen token is scanned to create an array from a whole string, separating elements by each occurrence of the token. Each element of the array will be treated as a line of text in the alert. Also, apostrophes (`'`) have to be escaped with a backwards slash (like so: `\'`). Aditionally, since it is an HTML fragment that is being included, the content passed to it is not processed as markdown. Links have to be written as HTML instead of markdown in alerts, etc...
0 commit comments