[pmwiki-users] capital first letters

Joachim Durchholz jo at durchholz.org
Thu Jun 30 06:56:13 CDT 2005


Hans wrote:
> Thursday, June 30, 2005, 12:07:11 PM, Joachim wrote:
> 
>>No guarantees for:
>>* The 'inline' line (another place in the markup sequence might be 
>>preferrable).
>>* The replacement string (it might have backslashes or quotes in the
>>wrong places).
> 
> Thanks for the warning, and for your answer!
> Unfortunately it does fill my screen with reg-replace error lines, and
> I don't know reg-replace to find the bugs.

Checked back and found that :upper: needs an extra pair of [] around it, 
so the regex should be
   '^[[:upper:]]/e'

I found another problem, and I don't know how to fix it: If a paragraph 
starts with markup, the uppercase letter won't be the first letter 
anymore, so you don't get it stylised. Actually that's exactly what one 
would want for, say, headlines and preformatted text, but not for, say, 
@@ or '''.

Finally, there's an inconvenience: the resulting HTML will have this 
structure:
   <p><span class='initial-cap'>H</span>ere goes.</p>
There's a pseudoclass .initial-char or something that applies a style 
just to the first character in a paragraph. If we could make PmWiki 
generate something like
   <p class='initial-cap'>Here goes.</p>
you could set up a .css file that said something like
   .initial-cap:initial-char {your-style-goes-here;}
(I probably got all the syntax horribly incorrect and am too lazy to 
look it all up, but this should get you started).

The advantage of going through the pseudoclass is that screen readers 
(e.g. for the visually impaired) will know that "Here" is a single word, 
while they might not now about that if the HTML were <span...>H</span>ere.

Regards,
Jo



More information about the pmwiki-users mailing list