In my version (1.5.7), in Scribus code, paragraphs and newlines are encoded in 
XML,
not with Unicode characters, and it is the same if I enter the text manually or copy it from a simple text editor.

<StoryText>
    <DefaultStyle/>
    <ITEXT CH="This is a paragraph up to this end-word."/>
    <para/>
    <ITEXT CH="This is a new paragraph, broken with a newline here"/>
    <breakline/>
    <ITEXT CH="until the end-word."/>
    <para/>
    <ITEXT CH="END"/>
    <trail/>
</StoryText>

Le 31.12.21 à 12:40, Bert Driehuis a écrit :
I would expect the unicode value \u000A to match just newlines (or \u000C if
you need to match CR).

It has become a bit of a black magic these days...


With kind regards,

Bert

On Fri, 31 Dec 2021 at 02:49, Matt Miller<matt.mil...@fastmail.com>  wrote:

I'm loading a text frame from a utf-8 encoded text file, and within my
Scribus Python code I want to search for the standard newline character,
ascii value 10. When I see an ascii 10 as the line separator I want to
apply a special paragraph style to the following paragraph. Most paragraphs
end with the Unicode paragraph separator character, \u2029, and in those
cases the default paragraph style is fine.

My problem is that both these types of characters are matching '\r' when I
use re.search in python. also, if I select either line separator character,
then do getText(), I get a '\r' no matter what. I've confirmed that my file
encoding is utf-8. What am I missing? How can I search for a simple '\n'
character?


--

   Matt Miller
   mailto:matt.mil...@fastmail.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <
http://lists.scribus.net/pipermail/scribus/attachments/20211230/3c1178f6/attachment.htm
___
Scribus Mailing List:scribus@lists.scribus.net
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL:<http://lists.scribus.net/pipermail/scribus/attachments/20211231/5519d97b/attachment.htm>
___
Scribus Mailing List:scribus@lists.scribus.net
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net


--
Silvain Dupertuis
Route de Lausanne 335
1293 Bellevue (Switzerland)
tél. +41-(0)22-774.20.67
portable +41-(0)79-604.87.52
web: silvain-dupertuis.org <https://perso.silvain-dupertuis.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.scribus.net/pipermail/scribus/attachments/20211231/3cbbbbb2/attachment.htm>
___
Scribus Mailing List: scribus@lists.scribus.net
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net

Reply via email to