Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-07-11 02:18:45

lythande
Member
Registered: 2009-09-08
Posts: 193
Website

Abbreviation with abbr

Hi,

(I dont know, is the right place here for this?)

could be textpattern / textile works only with <abbr>?
Because <acronym> is a non-standard-Element for HTML 5. See here: W3C say to acronym

In Germany we have abbreviations with only uppercase but also with upper- and small letters. e.g. “ABeR”. How I can get the small letters for the new code from TXP 4.5.7./4.6?
And I work much with Abbreviations, but I only use in the first abbr with a title, the other same abbr has not title – but has the same css-class.

In the last jears I have myself changing the line in classTextile.php for TXP 4.2.X-
I dont know, how it works with Textpattern 6.0

function glyphs($text) 
in: $glyph_search = array( ...
new:         '/\b([A-Za-z][A-Za-z0-9]{2,})\b(?:[(]()[)])/',            //  3+ upper+lowercase abbr #new 31.08.2010, with small letters for <abbr>ABC</abbr> without title 
changing: '/\b([A-Za-z][A-Za-z0-9]{2,})\b(?:[(]([^)]*)[)])/',            //  3+ upper+lowercase abbr #changing 30.08.2010, now also with small letters, original:'/\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/', which accept only uppercase.   //  3+ uppercase abbr 
... );
in: glyph_replace = array(...
new:         '<abbr><span class="abbr">$1</span></abbr>',  //  3+ abbr #new 31.8.2010 to say textile, there is an abbr-code without title - for repeated use of same abbr
changing: '<abbr title="$2"><span class="abbr" title="$2">$1</span></abbr>',  //  3+ upper+lowercase abbr  #changing from acronym to abbr, is needed for first abbr 26.10.09, original: <acronym title="$2">$1</acronym>
changing:  '$1$2',	 //  3+ upper+lowercase #changing <span class="caps">$1</span>$2 --> code deleted 26.10.09, for accept small letters (and not change it with CSS to big).
... );

best regards
Lythande

Last edited by lythande (2015-07-11 02:39:42)

Offline

#2 2015-07-11 08:56:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,524
Website

Re: Abbreviation with abbr

lythande wrote #293063:

could be textpattern / textile works only with <abbr>?

Textile has worked with <abbr> for a while now. But it will only output the tag if your doctype preference is set to HTML 5.

In Germany we have abbreviations with only uppercase but also with upper- and small letters. e.g. “ABeR”. How I can get the small letters for the new code from TXP 4.5.7./4.6?

I don’t know of a way to do that directly in Textile, sorry. This might be one of those things you have to mark up with HTML by hand. But feel free to mention it (raise an issue) at the official textile repository and see if anybody who monitors that channel can help.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2015-07-11 15:04:45

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,399

Re: Abbreviation with abbr

We had this topic a few years ago in the German forum. I think this is one of the weaknesses in Textile. I also make my individual changes in classTextile.php around the lines 543, 544, 566 and 567.

I think in general:

  • I’m not sure if it’s a good thing that Textile autodetects abbreviations.
  • Why not simply mark abbreviations with ABBR(), for example GmbH(Gesellschaft mit beschränkter Haftung)? So even small letters could be considered. GmbH() would parse <abbr>GmbH</abbr> and GmbH(Gesellschaft mit beschränkter Haftung) would be <abbr title="Gesellschaft mit beschränkter Haftung">GmbH</abbr>.
  • I don’t see why we need a <span class="caps">…</span> to wrap the <abbr>…</abbr>, it’s no problem to style the propper <abbr> element.

Offline

#4 2015-07-17 13:20:38

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,399

Re: Abbreviation with abbr

This post was lost beside other discussions. And it seems that the official textile repository is abandoned.

Offline

Board footer

Powered by FluxBB