New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added script and style tags like similar to slim #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is impressive!
There are a few formatting things that are weird and make it seem like there are more changes than there really are. I think those should be fixed before this is merged.
README.md
Outdated
</span> | ||
</span> | ||
</span> | ||
<span class="alongside" pid="#{Process.pid}"> | ||
<custom-tag id="with-id" pid="#{Process.pid}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those were here to test interpolation. Is that not working anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I added some more things to the slang side and then copied over the result... Interpolation still works. I just didn't notice that it stayed in the html side since it said "Compiles to HTML". I assumed it was the output not ecr. Sorry. I'll fix that.
src/slang/lexer.cr
Outdated
next_char | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened here? haha. Is that crystal tool format
?
src/slang/lexer.cr
Outdated
next | ||
end | ||
else | ||
if (close_char == '"' || close_char == '\'') && current_char == close_char && !escaped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about formatting, this is confusing.
src/slang/parser.cr
Outdated
@@ -14,6 +14,7 @@ module Slang | |||
def parse(io_name = Slang::DEFAULT_BUFFER_NAME) | |||
String.build do |str| | |||
loop do | |||
# puts "hello you" | |||
# puts token.inspect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well remove those comments :)
Should be good now. Sorry about that formatting. Apparently the vim-crystal plugin lost it's mind. |
Also changed the html output in the readme back to ecr. Sorry I didn't realize it wasn't pure html. |
README.md
Outdated
title This is a title | ||
style: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why suddenly we'd do the colon :
thing here? Is it a limitation of the tokenizer / lexer?
I think css:
and javascript:
would be appropriate, but style
and script
are real HTML tags that may have attributes and such.
Would it be possible to make them normal tags (no colon)?
@jeromegn I used the colon so that script and style could still be treated like a normal tag for things like |
This maintains the same functionality as slim with the difference in naming. I was hesitant to use javascript: and css: because slim has built in interpreters for multiple things, ruby:, coffee:, css:, json:. I didn't want to have to build all of those so it made sense to me just to name them by the element but still leave the :. One issue though is that normal script and style still end up escaped. I'll fix that too. |
@elorest I think we'd all be fine if only Sorry if this is a lot to ask. You're doing great! |
Done. I also fixed the inline style and script tags to not escape. |
Also fixed escaping in single line style and script tags
The nice thing about css: / javascript: is they work with slim syntax highlighter, which means no one has to maintain ide plugin for slang. Looking forward to seeing this merged. |
Well done! |
That's a good point. The slang vim plugin is maintained by me.
…On Apr 1, 2017 5:22 AM, "Cris Ward" ***@***.***> wrote:
The nice thing about css: / javascript: is they work with slim syntax
highlighter, which means no one has to maintain browser plugin for slang.
Looking forward to seeing this merged.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAHmpLiDEydlTi6RMmgnDtvDK1iKK8hEks5rrjOKgaJpZM4MwFae>
.
|
Took me a while to figure out how this was setup but I made script: and style: tags work similar to how css: and javascript: tags work in slim. I also added tests and updated the Readme.