tallforasmurf / PPQT

A post-processing tool for PGDP written in Python, PyQt4, and Qt
GNU General Public License v3.0
4 stars 2 forks source link

Can't move footnotes #118

Closed bibimbop closed 11 years ago

bibimbop commented 11 years ago

At the very end of the book, I have

/F F/

After checking the notes, renumbering them, I click on "move notes" and get the following error message:

Found no /F..F/ footnote sections.

If I add some junk words after the F tag, then I can move the notes.

/F F/ gjhgjhllkjhkshgd

tallforasmurf commented 11 years ago

The issue here is the regex used to find the footnote sections, QRegExp(u'\\n/F.*\\nF/\\n') As you see, it requires a newline to terminate the F/. If the document ends with exactly the letters F/ (If you hold down the right-arrow key, the edit cursor will not go beyond the /) then the search will fail.

It is only necessary to hit Return after F/ to make it work.

bibimbop commented 11 years ago

It's a usability issue.

QRegExp(u'\\n/F.*\\nF/(\\n|$)') seems to work for that purpose.

tallforasmurf commented 11 years ago

Of course, I use $ so rarely but it is exactly right for this.

tallforasmurf commented 11 years ago

148e194