Changeset 49147 in spip-zone


Ignore:
Timestamp:
Jun 28, 2011, 9:12:43 PM (10 years ago)
Author:
cedric@…
Message:

http://core.spip.org/issues/1815
Raccourci [ABBR|abbreviation{lang}]

Location:
_core_/plugins/textwheel/wheels/spip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _core_/plugins/textwheel/wheels/spip/spip.php

    r48566 r49147  
    44/**
    55 * callback pour la puce qui est definissable/surchargeable
     6 * @return string
    67 */
    78function replace_puce(){
     
    1112        return $puce;
    1213}
     14
     15/**
     16 * callback pour les Abbr :
     17 * [ABBR|abbrevation]
     18 * [ABBR|abbrevation{lang}]
     19 * @param array $m
     20 * @return string
     21 */
     22function inserer_abbr($m){
     23        $title = attribut_html($m[2]);
     24        $lang = (isset($m[3])?" lang=\"".$m[3]."\"":"");
     25        return "<abbr title=\"$title\"$lang>".$m[1]."</abbr>";
     26}
  • _core_/plugins/textwheel/wheels/spip/spip.yaml

    r41198 r49147  
    9292  priority: -20 # avant !paragraphes
    9393
     94abbr:
     95  # raccourcis en [ABBR|abbreviation]
     96  if_chars: "["
     97  if_chars: "|"
     98  match: "/\[([^\|\]>]+)\|([^\|\]\{>]+)(?:\{([a-z]+)\})?\]/S"
     99  is_callback: Y
     100  replace: inserer_abbr
     101
    94102intertitres-compliques:
    95103  # raccourcis imbriques en {{{{..}}}}
Note: See TracChangeset for help on using the changeset viewer.