Language name with dash #246
Conversation
|
Fixed. But now some coderay tests are failing. Any idea how to fix that or is there another |
Ok. Now I understand your test-setup better. I added an options-file as well. Should I add a test for coderay as well? |
42 | ||
end | ||
~~~ | ||
|
||
|
gettalong
Apr 20, 2015
Owner
Please only add an example that uses a valid, real world language. Otherwise people might think that ruby-trunk
is some kind of Ruby based language.
Personally, I would not add any example because we never explicitly state the syntax requirements for the language. Also if a user wants to highlight a programming language that contains a dash he will just use it in the fenced code blocks.
Please only add an example that uses a valid, real world language. Otherwise people might think that ruby-trunk
is some kind of Ruby based language.
Personally, I would not add any example because we never explicitly state the syntax requirements for the language. Also if a user wants to highlight a programming language that contains a dash he will just use it in the fenced code blocks.
maxmeyer
Apr 20, 2015
Author
Contributor
Fixed.
Fixed.
@@ -27,7 +27,7 @@ def self.call(converter, text, lang, type, _unused_opts) | |||
if type == :span && lang | |||
::CodeRay.scan(text, lang.to_sym).html(options(converter, :span)).chomp | |||
elsif type == :block && (lang || options(converter, :default_lang)) | |||
lang = (lang || options(converter, :default_lang)).to_sym | |||
lang = (lang || options(converter, :default_lang)).to_s.gsub(/-/, '_').sub(/language_/, 'language-').to_sym | |||
::CodeRay.scan(text, lang).html(options(converter, :block)).chomp << "\n" |
gettalong
Apr 20, 2015
Owner
The first gsub
I understand but why the second sub
?
The first gsub
I understand but why the second sub
?
maxmeyer
Apr 20, 2015
Author
Contributor
Fixed.
Fixed.
42 | ||
end | ||
~~~ | ||
|
gettalong
Apr 20, 2015
Owner
Why all the tests below? They don't make sense for this feature enhancement.
Why all the tests below? They don't make sense for this feature enhancement.
maxmeyer
Apr 20, 2015
Author
Contributor
To make sure, that a language with a dash behaves the same like a language without a dash
To make sure, that a language with a dash behaves the same like a language without a dash
maxmeyer
Apr 20, 2015
Author
Contributor
Removed.
Removed.
@@ -0,0 +1,2 @@ | |||
:enable_coderay: false | |||
|
gettalong
Apr 20, 2015
Owner
I think there shouldn't be any need for this file anymore since you modify the language name for coderay to use underscores instead of dashes.
I think there shouldn't be any need for this file anymore since you modify the language name for coderay to use underscores instead of dashes.
maxmeyer
Apr 20, 2015
Author
Contributor
I added this because the HTML generated without the coderay converter is much simpler and is the same like for the existing tests.
I added this because the HTML generated without the coderay converter is much simpler and is the same like for the existing tests.
Thanks for everything and your patience! The changes are now in master. |
Wonderful. |
Probably end of this week. |
|
@gettalong
A new one for #244. This line might be worth to mention. Without the addition
latex
is not able to compile the document. If you've got a better idea where I should place the code, I'm open for suggestions.