Contributed rclscribus fixes, thanks to Morten

This commit is contained in:
Jean-Francois Dockes 2015-04-20 09:16:37 +02:00
parent df4e3bf3e5
commit fb83946183

View File

@ -167,15 +167,24 @@ EOF
sed -e ':a' -e '/[^>] *$/N; s/\n/ /; ta' < "$infile" | \ sed -e ':a' -e '/[^>] *$/N; s/\n/ /; ta' < "$infile" | \
awk ' awk '
/<ITEXT / { /<ITEXT |<para|<trail PA/ {
if (match($0, " CH=\"[^\"]+")) { if (match($0, " CH=\"[^\"]+")) {
s=substr($0, RSTART+5, RLENGTH-5) s=substr($0, RSTART+5, RLENGTH-5)
printf("%s", s) printf("%s", s)
# Note: there is no way to know if this ends a frame, so no "<br>" # Note: No way to know if this ends a paragraph, so no "<br>"
# but it migth be good to have one in some instances
}
else if (match($0, "<para+")) {
printf("<br>")
# New paragraph so a <br>
}
else if (match($0, "<trail PARENT=\"+")) {
printf("<br>")
# End of something so a <br>
} }
} }
END { END {
print "</p></body></html>" print "</p></body></html>"
} }
' | \ ' | \
sed -e 's/&#x5;/<br>/g' -e 's/&#x1c;/<br>/g' -e 's/ /<br>/g' sed -e 's/&#x5;/<br>/g' -e 's/&#x1c;/<br>/g' -e 's/ /<br>/g' -e 's//<br>/g' -e 's// /g'