Comments (8)
This bug is preventing to move debian-history to migrate to XML.
It's not the bug in the normalization of output to the file but the way output strings are stored on @{$self->{TT}{doc_out}}. Although code expects array item to contain one line, it actually contain new line character for XML case.
If you carefully check output under debug, this is obvious since it lists multiple lines as the matched string. (Yes, it's too much to realize. I actually needed to change source to clearly mark matched line ... but that is another story) This reviled that array item contained multiple lines.
So what is needed seems to be something like:
@{$self->{TT}{doc_out}} = map {"$\n"} map {split '\n', $ } @{$self->{TT}{doc_out}};
This is a simple code to split multi-line item into multiple items of array. This sort-of works right if this is inserted after encoding setting before checking match with $position around line 651.
Now the question is the detail around "\n" handling. Avoiding perl odd rule using -1 for split seemed to be good thing to consider in order not to drop tailing "\n" for split. I thought doing the following seems to be better if each array item itself
@{$self->{TT}{doc_out}} = map {"$\n"} map {split '\n', $, -1 } @{$self->{TT}{doc_out}};
But this seems to produce too many "\n"s.
The initial map {"$_\n"} looks stupid time consuming code. So Setting one of:
- IO::Handle->output_record_separator( EXPR )
- $OUTPUT_RECORD_SEPARATOR
- $ORS
- $
seems to be good before "print" if you are perl speaker. But I only see "write" in code which doesn't do this trick. I am not good enough to judge code style.
So I propose to add following as patch to address this bug. This works OK to add translator names into legalnotice within bookinfo tag.
0001-Ensure-one-line-per-item-of-array.patch.txt
from po4a.
If you check my patch doesn't have any unwanted side effects, please upload new package with this fix. Than many XML doc get benefit of addendum for buster.
Please.
from po4a.
I will test your patch ASAP, but that's the beginning of the new term at university here. My free time is really scarce, sorry... Do not hesitate to ping me regularly if you don't see anything coming.
from po4a.
I am not familiar with test suite. Now that I have some idea how to change its behavior of parser for docbook without patching the source, test was done via "-o".
I tested on 4 simple XML book and article files based on examples in https://tdg.docbook.org/tdg/4.5/ with minor edits.
I think applying OPTION1 gives best result. po4a-normalize doesn't work, so there is some space for improvement. But this should give good reference test for book and article.
OPTIONS1 :=
-o nodefault=" "
-o break=" "
-o untranslated=" "
-o translated=" "
So default needs to be updated. I will propose patch later.
Here is the test run on 0.54
po4a-docbook-test.tar.gz
from po4a.
Apparently, pasting XML look-like doesn't work. See it in tarball. Sorry.
from po4a.
Hello again @osamuaoki
I have the feeling that this issue can be closed, since #153 was merged to master. Could you please confirm?
Thanks in advance,
from po4a.
Yah... this is non-issue now, I think
from po4a.
Thanks for confirming. Thus closing.
from po4a.
Related Issues (20)
- msgmerge removes all unknown flags (in particular markdown-text) HOT 18
- Typo in po4a doc HOT 2
- Mb -> MB in the po4a-gettextize docs
- Weblate: Set a repository browser URL for po4a-doc HOT 5
- How to generate Markdown without line wrap? HOT 2
- seems update to po4a to 0.70 breaks builds of apt HOT 14
- UTF-8 "\xF3" does not map to Unicode at /usr/share/perl5/vendor_perl/Locale/Po4a/TransTractor.pm line 583 HOT 5
- seems update to po4a to 0.70 the alternate language man pages are no longer installed. HOT 5
- Accept-Languages + Accept on website returns incorrect languages HOT 3
- docbook: Multiline entities not translated HOT 3
- Failed to run 'po4a-gettextize' for 'sgml' format (Error while running onsgmls -p) HOT 2
- Feature Request: Keep maintaining 'po4a-xxx' utilities HOT 4
- #☑️
- Malformed encoding while writing to file <output> with charset utf-8: Unknown failure HOT 3
- Error while build v0.71 on openSUSE HOT 12
- Markdown tables not parsed properly
- Lots of warnings and errors when building texinfo-docs with po4a-traslated texinfo.texi HOT 1
- Is it possible to use translated (but outdated version) of changed paragraph in translated file? HOT 2
- second argument to Locale::Po4a::TransTractor::read now mandatory HOT 2
- Problem after PerlIO overhaul in v0.70 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from po4a.