Rct567/FrequencyMan

<br> is deleted, leaving no space

Closed this issue · 3 comments

Fixed by adding "br|" in val = re.sub(r'</?(p|div|blockquote|h[1-6]|ul|ol|li|table|tr|td|th)([^>]*)>', ' ', val, flags=re.IGNORECASE) in text_processing.py.

That's expect behavior. <br> is an inline element and should not represent space or be able to divide words.

As someone else mentioned in the other issue you opened, it's best to correct the notes themselves if you're having issues with this.

That's expect behavior. <br> is an inline element and should not represent space or be able to divide words.

What the hell?

These pages suggest using it for poems and addresses (with no extra spaces):
https://www.w3.org/TR/2011/WD-html5-author-20110809/the-br-element.html
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br
https://www.w3schools.com/tags/tag_br.asp

Pressing Enter in the note editor adds a <br> (at least unless you do after an existing div or an HTML list).
movies2anki turns line breaks in subtitles into <br> and/or joins lines with it.

As someone else mentioned in the other issue you opened, it's best to correct the notes themselves if you're having issues with this.

I think mortii just wants to avoid adding even a bit of code: mortii/anki-morphs#142

Fair enough. I'll look into it.