Open GoogleCodeExporter opened 9 years ago
[deleted comment]
"comment extends" should be "string extends"
also, this is on r114
Original comment by mwisnicki@gmail.com
on 28 Sep 2010 at 12:44
Also, REGEX_LITERAL assumes C/C++ style comments which is not the case outside
of JavaScript.
Original comment by mwisnicki@gmail.com
on 28 Sep 2010 at 12:53
You are correct about general string terminators.
I need to handle ruby strings properly as well as perl style q(...), qq(...),
qw(...), m(...) and s(...)(...). Does ruby have a double string form like the
perl s/.../.../ construct?
ruby should recognize regular expression literals and hash comments though.
At line 1330 of prettify.js
registerLangHandler(sourceDecorator({
'keywords': RUBY_KEYWORDS,
'hashComments': true,
'multiLineStrings': true,
'regexLiterals': true
}), ['rb']);
Does this problem persist when you add lang-rb to the class along with prettify
to specify that the language is ruby?
<pre class="prettyprint lang-rb">
# Your ruby code here?
</pre>
Original comment by mikesamuel@gmail.com
on 4 Mar 2011 at 8:32
No, there are only regex options which look like: /whatever/i
It seems my examples were somewhat wrong/unclear but it does not:
1. detect regex literal at the start of the line:
/whatever/
2. detect regex in 'when' construct
3. terminate empty regex // because REGEX_LITERAL at
src/prettify.js:1010 assumes they are used for C++-style comments.
Yes
Attaching patch that fixes 'when /regex/' and adds highlighting of @@,
$$ and $ variables.
I have tried replacing + with * at line 1018 to theoretically unbreak
empty regex at the cost of breaking c++ comments, however it didn't
seem to fix the problem.
I've also tried adding '|^|' to REGEXP_PRECEDER_PATTERN to fix lines
starting with regex but it broke other things like division operator.
Original comment by mwisnicki@gmail.com
on 16 Mar 2011 at 3:19
Seems that attachments are stripped when responding by email.
Original comment by mwisnicki@gmail.com
on 16 Mar 2011 at 3:22
Attachments:
Argh... and quotations were also removed.
'Yes' is a response to question about lang-rb css class.
Original comment by mwisnicki@gmail.com
on 16 Mar 2011 at 3:28
Original issue reported on code.google.com by
mwisnicki@gmail.com
on 28 Sep 2010 at 12:41