[sword-devel] OSIS bold tag handling problem

Chris Little chrislit at crosswire.org
Tue Aug 11 18:47:21 MST 2009

Karl Kleinpaste wrote:
> We got a report that a module under development using <hi type="bold">
> was displaying in Xiphos using italics instead.  But it's OK in
> BibleDesktop and BibleTime.
> I found this in src/modules/filters/osishtmlhref.cpp:
>                 else if (!strcmp(tag.getName(), "hi")) {
>                         SWBuf type = tag.getAttribute("type");
>                         if ((!tag.isEndTag()) && (!tag.isEmpty())) {
>                                 if (type == "b" || type == "x-b") {
>                                         outText("<b>", buf, u);
>                                         u->inBold = true;
>                                 }
>                                 else {  // all other types
>                                         outText("<i>", buf, u);
>                                         u->inBold = false;
>                                 }
>                         }
> So nothing but "b" and "x-b" is accepted; everything else falls into the
> italics case.  Another person says this is a bug, that the set of <hi>
> type variants is
>   acrostic  bold        emphasis  illuminated  italic      line-through
>   normal    small-caps  sub       super        underline
> So, two questions:
> - Is it true that the code is bugged?

No. This isn't a bug report, it's a feature request--but it should still 
be attended to. (The "b" and "x-b" values predate definition of OSIS hi 

Many of the OSIS hi types are derived from CSS rendering directives, so 
to the extent that they can be mapped to HTML/CSS, they should be. But 
in the absence of a more specific mapping, <hi> should revert to the 
most neutral highlighting markup, which is italics.

> - If so, and we fix the code, how many existing modules that currently
>   use "b" and "x-b" will be broken, and/or is it reasonable to leave
>   "b" and "x-b" as acceptable alternate use cases?

It is not acceptable to remove "b" and "x-b" from Sword (not yet at 
least), but they should not be used in new OSIS documents.


More information about the sword-devel mailing list