PrettyText::JavaScriptError - horizRule when post text contains horizontal rule sequence


(Dean Taylor) #1

During an import I noted the following error when posts contained a sequence which could be interpreted as a horizontal rule.

e.g.

_____________

Or

>> -------

Full example post and backtrace can be found here:

#<PrettyText::JavaScriptError: PrettyText::JavaScriptError>
at horizRule (/var/www/discourse/vendor/assets/javascripts/better_markdown.js:785:46)
at Gruber.block.lists (/var/www/discourse/vendor/assets/javascripts/better_markdown.js:1048:43)
at processBlock (/var/www/discourse/vendor/assets/javascripts/better_markdown.js:246:31)
at toTree (/var/www/discourse/vendor/assets/javascripts/better_markdown.js:281:22)
at blockquote (/var/www/discourse/vendor/assets/javascripts/better_markdown.js:1115:35)
...

(Dean Taylor) #2

You can actually also see the error in the browsers “console” as an error.

  1. In this window, open debug console (Ctrl+Shift+i in Google Chrome)
  2. Switch make sure the console output is visible
  3. Hit Reply
  4. Paste in the text from here: https://gist.githubusercontent.com/DeanMarkTaylor/a5aca089a0b56a819968/raw/53e5e2133d9b60ca9a917e27f67a4d4290872a7a/example-post-text

Note error in console.


(Sam Saffron) #3

Should be fixed with:

https://github.com/discourse/discourse/commit/c5bd454ea6d4e9d00573d0610354b20cee969b98


(Sam Saffron) #4