pharo-smalltalk icon indicating copy to clipboard operation
pharo-smalltalk copied to clipboard

Prism syntax highlighting broken for Smalltalk empty strings

Open macta opened this issue 7 years ago • 6 comments

If you look at the rendered test suite pane for ReverseString, the colourised code is broken due to a quoted apostrophe. e.g. 'don''t break'

I'm not sure where the colouriser came from (I think @bencoman knows) - but we should report this issue and get it fixed.

macta avatar Feb 15 '19 15:02 macta

Can you paste a screen capture?

bencoman avatar Feb 16 '19 01:02 bencoman

@bencoman - the following is from the Test Suite tab of my Pharo track for the ReserseString exercise:

image

macta avatar Feb 16 '19 11:02 macta

So you mean its on the Exercism web site?
I can't find it - but maybe that is because I'm in "independent mode"

It looks like Exercism used to use Rouge syntax highlighter until Aug 21, 2018... https://github.com/exercism/website/commit/464287fa3#diff-8b7db4d5

and now use Prism... https://github.com/exercism/exercism/issues/4044

Can reproduce the above snapshot online at... https://prismjs.com/test.html pasting in code from... https://github.com/exercism/pharo/blob/master/dev/src/Exercism/ReverseStringTest.class.st

Concise test...

anObject withEmptyString: ''  shouldNotBeGreenHere: 'shouldBeGreenHere'

https://prismjs.com/test.html displays incorrect... image

http://rouge.jneen.net/ displays correct... image

bencoman avatar Feb 16 '19 15:02 bencoman

Actually I discover the error starts on line 34 of the snapshot due to the empty string. Reported here... https://github.com/PrismJS/prism/issues/1746

bencoman avatar Feb 16 '19 15:02 bencoman

Confirming https://prismjs.com/test.html displays quoted apostrophes correctly... image

bencoman avatar Feb 16 '19 15:02 bencoman

Ben managed to get a fix in prism (https://github.com/PrismJS/prism/pull/1747) but not sure how exercism pulls in prism? When there is the next release, will it just get included?

macta avatar Feb 18 '19 13:02 macta