[sword-devel] RTF in conf files

Troy A. Griffitts scribe at crosswire.org
Tue Apr 16 05:35:50 EDT 2024


There is an SWFilter to help with this.

E.g., to get HTML, try something like:

#include <rtfhtml.h>
SWBuf confValue = module.getConfigValue("About");
RTFHTML().processText(confValue);

If you don't want HTML, I believe there are also other RTF filter conversions like RTFPlain which should give you things like your newlines instead.

On April 16, 2024 04:20:51 GMT-03:00, domcox <dominique at corbex.org> wrote:
>
>Only a very small, restricted subset of RTF markup is supported, see:
>https://wiki.crosswire.org/DevTools:conf_Files#RTF
>
>
>"David \"Judah's Shadow\" Blue" <yudahsshadow at gmx.com> writes:
>
>> I'm working on an info command to display some basic info about modules, and I
>> ran into the fact that, at least in the About entry, the conf file can contain
>> RTF formatting. As it stands I strip out \pard, replace \par with \n, and
>> strip out the tag portion of any anchor/link tags found. My question is, are
>> there any other tags that are likely to appear in conf entries that I should
>> be either handling or stripping (since my front end does no formatting of text
>> whatsoever)?
>
>
>-- 
>Dom
>_______________________________________________
>sword-devel mailing list: sword-devel at crosswire.org
>http://crosswire.org/mailman/listinfo/sword-devel
>Instructions to unsubscribe/change your settings at above page

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://crosswire.org/pipermail/sword-devel/attachments/20240416/bd73b6c4/attachment-0001.htm>


More information about the sword-devel mailing list