Opened 10 years ago

Last modified 5 months ago

#8377 new defect

Underlined acronyms aren't always converted — at Version 1

Reported by: Ben Allen Owned by: Ryan J Ollos
Priority: normal Component: AcronymsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

When an acronym is underlined, AcronymsPlugin does not detect it or add the <acronym> tag to it. If the acronym contains other style elements "inside" the underline, then the acronym is tagged as expected.

For example, take the following wiki content: Acronym test: SCSI __SCSI__ '''SCSI''' ''SCSI'' '''''SCSI''''' __''SCSI''__ __'''SCSI'''__ ''__SCSI__'' '''__SCSI__''' '''__''SCSI''__'''

The following HTML is generated (newlines added for readability):

Acronym test:
<acronym title="Small Computer Simple Interface">SCSI</acronym>
<span class="underline">SCSI</span>
<strong><acronym title="Small Computer Simple Interface">SCSI</acronym></strong>
<em><acronym title="Small Computer Simple Interface">SCSI</acronym></em>
<strong><em><acronym title="Small Computer Simple Interface">SCSI</acronym></em></strong>
<span class="underline"><em><acronym title="Small Computer Simple Interface">SCSI</acronym></em></span>
<span class="underline"><strong><acronym title="Small Computer Simple Interface">SCSI</acronym></strong></span>
<em><span class="underline">SCSI</span></em>
<strong><span class="underline">SCSI</span></strong>
<strong><span class="underline"><em><acronym title="Small Computer Simple Interface">SCSI</acronym></em></span></strong>

which displays as:


The underlined text was not made into an acronym. The underline + italics and underline + bold cases were, but only if the underline markup was on the *outside* of the bold/italics markup. Curiously enough, the underline + bold + italics case works as long as the underline is not the innermost markup element.

My guess is that the parser is allowing underscores in an acronym and is interpreting the double-underscore as part of the acronym (thus it doesn't match anything in the acronym list so it doesn't get tagged). Stripping off leading and trailing non-alphanumeric characters before comparing the text to the acronym list should fix this problem, but I haven't tried to patch it myself so I can't say for sure.

Change History (1)

comment:1 Changed 10 years ago by Ryan J Ollos

Description: modified (diff)
Priority: normalhigh
Status: newassigned
Note: See TracTickets for help on using tickets.