jespersandal / drupal-fixer

Fixing common errors with character encoding and markdown in articles.
0 stars 0 forks source link

Double quotes inside a quote causes the slicing to fail #5

Open jespersandal opened 7 years ago

jespersandal commented 7 years ago

As I fixed a hanging issue with quoted sentences beginning and ending with linebreak, I found that use of double quotes inside another quote causes the slicing to fail.

Example from the test dodument:

“Skærer man konstant i hjørnerne, får det den konsekvens, at der skal bruges mere antibiotika, hvilket på sigt gør, at vi havner i det der bliver kaldt en “post-antibiotisk” tidsalder, hvor vi risikerer at dø af de selvsamme rifter som man døde af i middelalderen,” forklarer David Pedersen og tilføjer:

It might be solvable with additional logic to check if we have a valid quote beginning and then ignore the double quotes inside it, until we get a valid ending.

It causes a second problem, when the end of the quote is missing punctuation. It might be possible to create a rule that can detect missing punctuation.

Also, we should add accent grave to the single quote replace block.