Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

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

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.


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

Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,690

Re: Attribute hreflang and type for links

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 ?


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

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


$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);

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


Board footer

Powered by FluxBB