Add [section] header and footer filters

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
dfhtextpipe
Posts: 986
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Add [section] header and footer filters

Post by dfhtextpipe »

The issue I raised with the subject Exact is not exact also applies to the filters Add [section] header and footer filters.

Because these filters permit the inclusion of global variables, it means that the content has to be parsed.
Because the content is always parsed, this means that anything that matches a Perl regexp gets treated as such.

Here's a recent example:

Code: Select all

\c 4
\s Ewe ränin Kot epwe war
\sr 4.1-6
\p
\v 1 Iei alon ewe Samol mi Unusen Manaman, “Nengeni, epwe war eu rän, epwe pulopul usun eu um. Iwe, ekewe chon lamalamtekia me ekewe chon föföringau repwe wewe ngeni fetilipwas. Lon ewe rän ekkei epwe kenirela pwe esap chüen wor eman lusun.
\v 2 Nge usun akkar a asarama fanü, iei usun pwüng epwe uwato manau ngenikemi mi aleasochisiei. Ämi oupwe towu o mwetemwet usun chök ekewe nienifön kow ra mwetemwet lupwen ra towu seni lenier.
\v 3 Lon ewe rän üpwe afisi ekei föför, ämi oupwe purätiu ekewe aramasangau, nge ir repwe usun chök falang me fän pechemi.
\v 4 Oupwe chechemeni mine üa aiti ngenikemi ren nei we chon angang Moses, ekewe allük me pwüüng üa ngenikemi me won ewe chuk Horep fän iten chon Israel meinisin.
\p
\v 5 Nengeni, ngang üpwe tinala remi ewe soufos Elias me mwen ränin ewe Samol mi Lapalap epwe war, ewe rän mi lap o eniweniu.
\v 6 Epwe akulu leluken ekewe sam ngeni nöür kewe, nge leluken ekewe nau ngeni semer kewe. Nge ika esap fis ei, üpwe feito o ataela ewe fanü ren eu anümamau.”
I found it necessary to replace the "\" by "\\" in the external file, thus:

Code: Select all

\\c 4
\\s Ewe ränin Kot epwe war
\\sr 4.1-6
\\p
\\v 1 Iei alon ewe Samol mi Unusen Manaman, “Nengeni, epwe war eu rän, epwe pulopul usun eu um. Iwe, ekewe chon lamalamtekia me ekewe chon föföringau repwe wewe ngeni fetilipwas. Lon ewe rän ekkei epwe kenirela pwe esap chüen wor eman lusun.
\\v 2 Nge usun akkar a asarama fanü, iei usun pwüng epwe uwato manau ngenikemi mi aleasochisiei. Ämi oupwe towu o mwetemwet usun chök ekewe nienifön kow ra mwetemwet lupwen ra towu seni lenier.
\\v 3 Lon ewe rän üpwe afisi ekei föför, ämi oupwe purätiu ekewe aramasangau, nge ir repwe usun chök falang me fän pechemi.
\\v 4 Oupwe chechemeni mine üa aiti ngenikemi ren nei we chon angang Moses, ekewe allük me pwüüng üa ngenikemi me won ewe chuk Horep fän iten chon Israel meinisin.
\\p
\\v 5 Nengeni, ngang üpwe tinala remi ewe soufos Elias me mwen ränin ewe Samol mi Lapalap epwe war, ewe rän mi lap o eniweniu.
\\v 6 Epwe akulu leluken ekewe sam ngeni nöür kewe, nge leluken ekewe nau ngeni semer kewe. Nge ika esap fis ei, üpwe feito o ataela ewe fanü ren eu anümamau.”
This is very annoying!

For such filters the user ought to be given the option to parse or not parse the added header or footer,
irrespective of whether it's an external file or an internal set of text lines.

When "not parse" is selected, the specified text should be added exactly as it is without any interpretation by the regexp parser.

David
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Add [section] header and footer filters

Post by DataMystic Support »

Hi David,

Thanks for your suggestion. It may be better to simply *not* parse external files, only text in the UI. What do you think?

I believe you can add a subfilter of the Add [section] header and footer filters to pre-parse the file, such as to double up backslashes.
dfhtextpipe
Posts: 986
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Add [section] header and footer filters

Post by dfhtextpipe »

Intriguing! That suggestion had never occurred to me!
I suppose it's not documented in the help file what would happen if you include a replace filter as a sub-filter of the add header/footer filter.

As for only parsing the text specified within the filter UI form, that makes good sense to a certain degree.
Yet would making the change break anyone's filters? Backwards compatibility should be the deciding factor.
One can't be sure if something vital out there depends on parsing an external add header or add footer file.

So my preference would still be to have parsing both internal/external header/footer as the default,
but included a "ticked by default" tick box in the improved UI form, if you see what I mean.

David
David
Post Reply