Skip to content
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

Minor fixes for HTML, CSS and JavaScript #916

Merged
merged 2 commits into from
Jun 19, 2018

Conversation

miparnisari
Copy link
Contributor

@miparnisari miparnisari commented May 20, 2018

Fix CSS: space is allowed between ! and important
Fix HTML: space is allowed before and after equal signs for attributes
Fix JS: allows \n as a string

Fix HTML: space is allowed before and after equal signs
Fix JS: allows \n as a string
Copy link
Collaborator

@dblessing dblessing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One simple question, given my lack of JS experience. Otherwise, looks good. Thanks @miparnisari

@@ -206,6 +206,7 @@ def self.id_regex

state :dq do
rule /[^\\"]+/, Str::Double
rule /\\n/, Str::Double
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm no JS expert so forgive me if this is silly. In JS, does the \n come out of the string exactly as is, or is it interpreted as a newline? For example, in Ruby:

# This would output a literal `\n` in the string. Would not be interpreted as a newline
single_str = 'This is a string\n'

# This would output a string with an actual newline.
double_str = "This is a string\n"

If JS treats the \n as Ruby does with single quotes then the ways it's written in this PR is perfect. If JS actually interprets it as a newline as in Ruby with double quotes, then it may be nice to change the token to Str::Escape so it's highlighted differently than surrounding text.

Copy link
Contributor Author

@miparnisari miparnisari Jun 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, JS outputs an actual newline in both cases, so it's like Ruby with double quote. I'll fix this later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@dblessing dblessing added the author-action The PR has been reviewed but action by the author is needed label Jun 13, 2018
@dblessing dblessing merged commit 02693ae into rouge-ruby:master Jun 19, 2018
@dblessing
Copy link
Collaborator

Thanks @miparnisari

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-action The PR has been reviewed but action by the author is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants