Comments (7)
I've added escaping and interpolation detection into the lexer in this pull request.
#16 I'm not sure if it's perfect, but it fixes the examples here.
from slang.
Yes. I attempted that at some point but got frustrated with my macro chops not being good enough.
I'm sure this is a fairly simple change if somebody can wrap their head around it, else I can give it another shot soon enough!
Thanks for the report.
from slang.
Any thoughts @kRaw1er ?
from slang.
I just ran into this as well. Using @RX14 's example, here's another workaround:
- thread_id = thread["id"]; thread_subject = thread["subject"]
a href="/t/#{thread_id}" = thread_subject
from slang.
@jasonl99 having to work around it is unfortunate.
I absolutely want to fix this, but the lexer is currently making my head spin. I wish some parsing libs were more mature (slim, for example, uses a popular ruby parser gem.)
IIRC, there are one or two for crystal (like: https://github.com/umurgdk/haydari) but they are outdated and usually WIP.
from slang.
On the same note, I'd expect attr=blah
for blah to be HTML.escape
d and attr==blah
to be unescaped. This doesn't appear to be the case, which could allow XSS attacks. This can be worked around by using HTML.escape
around your attribute values, but this is easy to forget.
from slang.
Should be fixed as of 1.4.2. Thanks @crisward!
from slang.
Related Issues (20)
- Windows end of line can give issues HOT 2
- slang with strings? HOT 2
- Can't find file "secure_random" HOT 1
- Incorrect parse of attribute value causes error HOT 1
- Can we see Slang adding JSON building (feature suggestion). HOT 5
- Add HTML entity support to Slang HOT 2
- Allow unescaped interpolation HOT 2
- Minify HTML output
- Multiline attributes inside an attribute wrapper
- Embedded HTML with double quoted attributes breaks interpreter
- Question: HTML HOT 1
- Backslash handling HOT 1
- What about HTML Boolean Attributes? HOT 1
- How to do ternary conditional statement? HOT 1
- Convert .html file to .slang file HOT 1
- Use of conditionals HOT 3
- Kilt dependency and Kemal HOT 3
- Compile Time or Runtime? HOT 1
- Render variable content as unescaped HTML HOT 1
- Cannot build docs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slang.