Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Paragraph Quote Highlighting #546

Closed
ben-albon opened this issue Dec 30, 2020 · 4 comments · Fixed by #577
Closed

Multi-Paragraph Quote Highlighting #546

ben-albon opened this issue Dec 30, 2020 · 4 comments · Fixed by #577
Assignees
Labels
enhancement Request: New feature or improvement not a bug Invalid: Feature, not a bug
Projects

Comments

@ben-albon
Copy link

I personally find quote highlighting to be one of the most appealing features of novelWriter, but it doesn't seem to correctly handle multi-paragraph quotes.

In a multi-paragraph quote, to indicate the original speaker is still talking, the first paragraph is left open: no closing quotation marks are placed. Without those closing quotation marks, novelWriter does not highlight the first paragraph of the quote.

The expected behaviour is that all quoted text in both the first, and all subsequent paragraphs, would be highlighted.

@ben-albon ben-albon added the bug Issue: Something isn't working label Dec 30, 2020
@vkbo
Copy link
Owner

vkbo commented Dec 30, 2020

Yes, this is not really a bug. Markdown doesn't generally allow formatting tags to span multiple lines. The Qt syntax highlighter also applies highlighting to only one line of text at a time (called a text block in Qt), and by default has no knowledge of the line above or below. These two combined is why that particular feature doesn't span paragraphs (or lines if you add line breaks within a paragraph).

In principle, hanging quotes can be supported by considering a line break as a valid (temporary) closing quote. However, that only works if the writer follows the convention of using a new opening quote mark for the following paragraph(s) and leave them hanging until the end of the quote. Unfortunately, that can only work with double quotes (assuming English language quote style) as the highlighter would be confused by hanging single quoted paragraphs with apostrophes in the text.

I can certainly add support for hanging quotes, but I will then make them optional. You'd probably want to switch them off for single quotes for English, but for other languages where single quote and apostrophe are distinct symbols, you may want it enabled. You can also use the alternate unicode symbol for apostrophe available from the Insert menu. The symbol is not the recommended one by style guides, but in most fonts it renders exactly the same as an English closing single quote.

@vkbo vkbo added enhancement Request: New feature or improvement not a bug Invalid: Feature, not a bug and removed bug Issue: Something isn't working labels Dec 30, 2020
@vkbo vkbo self-assigned this Dec 30, 2020
@vkbo vkbo added this to To Do (Features) in Release 1.1 Jan 14, 2021
@vkbo vkbo added this to the Release 1.1 RC 1 milestone Jan 15, 2021
@vkbo
Copy link
Owner

vkbo commented Jan 19, 2021

Ok, so I've tested allowing highlighting for dialogue with no closing quote, following the rules described at the end of this masterclass article. It seems to be working just fine, and I've added options for enabling/disabling this feature to the Preferences. Due to the possible conflict with the apostrophe, I've added separate options for single and double quotes.

I'll make a pull request to the dev branch later today, so the feature should be available in the development version then, and part of 1.1 RC1 when that's ready.

@vkbo vkbo moved this from To Do (Features) to In Progress in Release 1.1 Jan 19, 2021
@vkbo vkbo linked a pull request Jan 19, 2021 that will close this issue
vkbo added a commit that referenced this issue Jan 23, 2021
@vkbo
Copy link
Owner

vkbo commented Jan 23, 2021

I've now merged the new feature into the dev branch. Feel free to test it, and see if it covers your feature request. I'll leave the issue open for now.

@vkbo vkbo moved this from In Progress to Done in Release 1.1 Jan 23, 2021
@vkbo vkbo moved this from Done to In Progress in Release 1.1 Jan 23, 2021
@vkbo vkbo moved this from In Progress to Done in Release 1.1 Jan 23, 2021
@vkbo
Copy link
Owner

vkbo commented Jan 30, 2021

This will be included in Version 1.1 RC 1 that I'll release tomorrow after some more testing.

@vkbo vkbo closed this as completed Jan 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request: New feature or improvement not a bug Invalid: Feature, not a bug
Projects
No open projects
Release 1.1
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants