ntrupin / abstractml

An HTML abstraction focused on simplicity, with support for JavaScript and CSS. Perfect for experts and beginners!

Home Page:https://ntrupin.github.io/abstractml/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update compiler.js to use template literals

Yamboy1 opened this issue · comments

Is your feature request related to a problem? Please describe.
This won't affect the end result, but I feel like the code would look cleaner, and that would make it much more readable

Describe the solution you'd like
Basically, replacing

output = "<h1 " + v[1] + ">" + c[1] + "</h1>"

with

output = `<h1 ${v[1]}>${c[1]}</h1>`

Describe alternatives you've considered
This appears to be the cleanest idea i can think of at the moment

Additional context
You can see my img tag for another example of how to use this: https://github.com/ntrupin/LineScript/blob/master/src/compiler.js#L126
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

I will get to work on it. Thanks for the idea!

@Yamboy1 , I began the transition, though I won't be able to finish until later tomorrow.

We could either wait until then, or, if you are willing to help, you could finish and submit a pull request.