Cuperino / QPrompt-Teleprompter

Teleprompter software for all video creators. Built with ease of use, productivity, control accuracy, and smooth performance in mind.
https://qprompt.app
GNU General Public License v3.0
355 stars 22 forks source link

Carriage returns not behaving as expected #207

Open videosmith opened 10 months ago

videosmith commented 10 months ago

Bug Description I do not believe this is a fault in your program, however if you have a workaround it would be helpful. Some .docx files I receive have 'soft' carriage returns to delineate paragraphs. These are ignored when pasted in to other applications like Qprompt.

Steps to Reproduce

  1. Load sample file Test-orig.docx
  2. Select all, copy and Ctrl-Shift-v paste into Qprompt, stripping formatting.
  3. Paragraphs contiguous.
  4. Clear Qprompt or start another instance.
  5. Load sample file Test-hard.docx (I manually inserted hard returns between paragraphs)
  6. Repeat step 2 with this file
  7. Paragraphs separated

Expected behavior Apps should recognize and honor soft carriage returns

Screenshots (optional) screen screen01 screen02 screen03

test.zip

screen04

Device information

Cuperino commented 10 months ago

The issue is likely caused by the fact that we're parsing HTML. In this language, soft carriage returns are dealt with in the same way as regular spaces and there's a special DOM object for soft carriage returns, which is <br>. If we do a find and replace on the source, where the soft carriage returns are replaced with
, we should be able to get the desired behavior.

IDK if those are actually copied into the HTML or replaced with regular line endings, but if that's the case, which I think it's likely, this fix would work.

videosmith commented 10 months ago

So I should adjust the source before copy/paste into QPrompt?

Cuperino commented 10 months ago

Shouldn't be needed. I tried replicating the issue with using the latest version of QPrompt and LibreOffice 7.3.7.2, but I couldn't replicate it. This version of LibreOffice is correctly adding <br/> to the code, so no changes in QPrompt should be needed.

Which version of LibreOffice are you using?

videosmith commented 10 months ago

7.4.4.2 on intel Debian 12.17.3.7.2 on Ubuntu 22.04 ARM It occurs in both systems (Qprompt 1.2 R6) Your attempts to copy /aste my attached files parsed correctly?

Cuperino commented 10 months ago

Your attempts to copy/paste my attached files parsed correctly?

The answer to this question would depend on how we define correctly. One of QPrompt's features is that it ignores settings like paragraph and line height, which can mess up the text being prompted when it is copied from places such as a random site on the Internet. The decision to do it this way came from the fact that a local station used copy paste from a web browser into Imaginary Teleprompter, and it would mess up the prompter in many ways.

When the HTML is processed in QPrompt, formatting is stripped so that each paragraph's lines occupy, more or less, the same height (subject to the font being used).

owangutang commented 1 month ago

I'd wager this stems from a setting in Libre Office akin to Word's "add space at the end of paragraph" option. It's a hand-holding feature to reduce keystrokes so you don't have to hit Enter twice to get a gap between grafs.

As seen in the first screenshot's "heading", both the pilcrow and carriage return symbols indicate that text should start on the next line down. In the "body," the pilcrows are padded to put space between the paragraphs. There's nothing in the document to make the wanted space outside of Libre Office's own style interpretation.

Cuperino commented 1 month ago

What @owangutang has written goes hand in hand with what I had written before. QPrompt disregards most of the styling that comes from other editors and uses its own to guarantee line spacing is consistent. This means that while soft and hard breaks may be present, these will look the same because that's how it's stated by QPrompt's own CSS style.

ChrigiGee commented 4 weeks ago

Hi there, Hi Qpromt,

By a Text I made, I have a bit of a mistake version. For Example, the beginning Headline: Geschichte & Schätze it's without a Return in the Original File, below. In Qpromt I have "Geschichte "Return" & Schätze" for Example and middle of Text possible I have a Return, but the Original File doesn't have.

In an HTML File, it's works most time, only RTF I found this.

Second, LibreOffice not found, sorry I will open another case about.

Kind regards Chris

Image 2024-06-04=1717509987 Image 2024-06-04=1717510237 Image 2024-06-04=1717510328 Image 2024-06-04=1717510517

Cuperino commented 4 weeks ago

@ChrigiGee Could you provide copies of the original file in its original format and of the file produced by QPrompt? I need to look into the file's contents to figure out what's going on...

Also, what version of TextMaker / SoftMaker Office are you using?

ChrigiGee commented 4 weeks ago

Hi Javier,

I used SoftMaker NX, TextMaker NX Universal (rev S1214.0518) 64bit

Of course, I can send here an RTF I used. Sorry I not like to upload zip Files, but the System not accepted RTF Files.

QPromt Test.zip

I think it's for other Users if he works with SoftMaker in the German Part of Europe, fascinating too.

Kind regards Chris

Cuperino commented 4 weeks ago

Thank you. SoftMaker NX appears to have a free trial option, I'll get the free trial when I have the time to attend and potentially fix this issue.

I apologize for the inconvenience because this will likely take a few months. Our pipeline for making new releases is broken, and I'm building a new one while porting the software to use newer versions of the libraries it was built on.