Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-07-22 16:56:13

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Attribute hreflang and type for links

It would be quite nice to be able to specify a lang for the link used in the articles (parsed by Textile) and maybe also the type, aka the use of the hreflang and type attributes for the a tag.

Offline

#2 2005-07-23 01:15:05

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: Attribute hreflang and type for links

Oh!
I’ll support this.

Doing it manually is no biggie for me, but not eveyone is inclined to handcode html.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#3 2005-10-31 08:04:06

succhi
New Member
From: Brisbane, Australia
Registered: 2005-03-25
Posts: 4

Re: Attribute hreflang and type for links

Does anyone know if this has moved forward. In classTextile.php it appears there is provision for attributes but that don’t seem to be captured in the regex and thus aren’t used. I am not very strong with regex yet so I have spent far too long looking at this. I just need a simple way to add a class attribute to a link.

From what is in classTextile

<pre>

$this->clas = “(?:\([^)]+\))”; //(class)
$this->lnge = “(?:\[[^]]+\])”; //[language]
$this->styl = “(?:\{[^}]+\})”; //{style}
$this->c = “(?:{$this->clas}?{$this->styl}?{$this->lnge}?|” .”{$this->styl}?{$this->lnge}?{$this->clas}?|” .”{$this->lnge}?{$this->styl}?{$this->clas}?)”;

return preg_replace_callback(‘/ ([\s[{(]|[[:punct:]])? # $pre “ # start (’ . $this->c . ‘) # $atts ([^”]+) # $text \s? (?:\(([^)]+)\)(?=”))? # $title “: (\S+\b) # $url (\/)? # $slash ([^\w\/;]*) # $post (?=\s|$) /Ux’, array(&$this, “fLink”), $text);
</pre>

It looks like you should be able to write
"(class)link text(title)":http://url.com

Offline

Board footer

Powered by FluxBB