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

Version 1.9.19 drops spaces between words #533

Closed
prichterich opened this issue Nov 26, 2024 · 12 comments
Closed

Version 1.9.19 drops spaces between words #533

prichterich opened this issue Nov 26, 2024 · 12 comments
Assignees
Labels
bug Something isn't working investigating Investigating the issue priority-high
Milestone

Comments

@prichterich
Copy link

htmdoc version 1.9.19 drops spaces between words in generated PDF files. This seems to be a new bug, possible buffer and/or keyword related. A simple example is attached.
htmldoc_spaces_bug.zip

@michaelrsweet
Copy link
Owner

It doesn't look like there is a buffer/keyword issue - HTML output preserves the spacing so there is something happening when the PDF/PS output is formatted.

Was the last version you used 1.9.3? I haven't had any reports of this issue before so I need to figure out when this broke...

@michaelrsweet michaelrsweet self-assigned this Nov 27, 2024
@michaelrsweet michaelrsweet added bug Something isn't working investigating Investigating the issue priority-high labels Nov 27, 2024
@michaelrsweet michaelrsweet added this to the Stable milestone Nov 27, 2024
@totalAldo
Copy link

This is also happening to me and the last version I used was 1.9.18

@michaelrsweet
Copy link
Owner

@totalAldo Great, thank you that helps a lot!

@michaelrsweet
Copy link
Owner

This might be a regression caused by the fix for #528. Investigating...

@prichterich
Copy link
Author

Version 1.9.3 is the last version that I can use for our application. Versions after that one have bugs that make the PDF files generated useless. One of these problems was the broken links to external files, which I previously reported. That seems to be fixed in this release, but the missing spaces issue again prevents upgrading.

@prichterich
Copy link
Author

The reason I suggested it might be a buffer and/or keyword issue is that I only observed the problem when files are large enough (> 1 kb), and the drops seemed more common before words like "as" and "for". Adding content (plain text paragraphs) at the beginning of a file can change where or if the problem occurs. But it's just a guess, and spaces are removed before other words, too.

@michaelrsweet
Copy link
Owner

OK, I reverted that one change and it didn't make a difference.

@prichterich
Copy link
Author

If you want me to check changes before a release, I'd be happy to. I use htmldoc to generate a help file with about 400 pages from many dozens of source files, organized in multiple folders. We also generally check the PDF carefully for problems.

@michaelrsweet
Copy link
Owner

@prichterich I've found the cause - the code to drop the leading space in some situations was modifying the string in place, which wasn't a problem until I added the string pool for 1.9.19, so duplicate strings started using the same pointer and storage...

Try the latest code on Github:

[master 38f89c2] Fix regression causing missing whitespace (Issue #533)

@prichterich
Copy link
Author

prichterich commented Nov 28, 2024

Took me a while but I got it to build from the command line. Had to remove the x86 built from the architecture line in Makedefs since some of the used libs are installed as arm only.

@prichterich
Copy link
Author

prichterich commented Nov 28, 2024

The spaces issue is fixed, but unfortunately, not all file links work. There seem to be some patterns, though. Many links that are broken (show up as file links) are to a file in a sub-directory, like this:
<a href="edit/edit_undo.htm">Undo</a>
If there is a named link after the file name, then the link works. Example:
<a href="edit/edit_copy.htm#paste">Paste</a>

-- Edit: --
I thought there also was another problem at the end of paragraphs, but those seem to be due to errors in the links (wrong case or file not included in the book).

@michaelrsweet
Copy link
Owner

@prichterich If you aren't getting an error/warning about the missing link, please file a new bug for that so I can fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigating Investigating the issue priority-high
Projects
None yet
Development

No branches or pull requests

3 participants