Headlines with parentheses, question marks not parsed as headlines
ernstki opened this issue · 2 comments
Headlines that contain certain characters (which look like they could be regex metacharacters) do not get parsed as headlines. I haven't done an exhaustive search, but I've noticed that parentheses and question marks are among the characters that cause this.
I'm using version 1.0.9 freshly installed with gem install
on macOS Mojave (10.14), with the built-in Ruby 2.3.7something.
Given this input, I expect all three headlines to be parsed correctly:
mdless <(echo "# A header (with parentheses)
Words.
## a subheader - with a question mark?
Words, words.
## a subheader with no funny stuff
Words, words, words.")
…but only the third headline "a subheader with no funny stuff" actually is. The output looks like this:
If you remove the offending characters (parentheses and question marks in this example), you get the expected output:
I'm no whiz at the git bisect
ing, but I'm pretty sure this behavior didn't exist a year or so ago, when I was using mdless
to run terminal-based "slideshows" for a workshop.
@ttscoff I'm happy to do a PR (and even include tests that catch the above bad behavior) if you can give me a gentle push in the right direction.
Since I'm not a real Ruby developer, my efforts to look into the situation after git clone
ing the repository were somewhat frustrated when bundle exec rake
just gave me a backtrace (#43).