Skip to content

Instantly share code, notes, and snippets.

@mynameislau
Created April 20, 2017 11:58
Show Gist options
  • Save mynameislau/2c5bb88cfebd9181988fa3ee2ea318c5 to your computer and use it in GitHub Desktop.
Save mynameislau/2c5bb88cfebd9181988fa3ee2ea318c5 to your computer and use it in GitHub Desktop.
main -> stuff {% id %}
stuff -> itaStuff {% id %}
| textStuff {% id %}
textStuff -> text ita textStuff {% id %}
| text {% id %}
| null {% id %}
itaStuff -> ita text itaStuff {% id %}
| ita {% id %}
| null {% id %}
ita -> "*" text "*" {% ita %}
text -> [^*]:+ {% text %}
@{%
const typed = (type) => (data) => ({ type, data})
const dataToString = data => data.join('').split(',').join('');
const ita = (data, location, reject) => {
return `<i>${dataToString(data)}</i>`;
}
const text = (data, location, reject) => {
return `<p>${dataToString(data)}</p>`;
}
%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment