From: Stefan <son...@ba...> - 2005-11-29 16:14:50
|
Hello, i'am using styles in wiki code 1%color=red%2%%3 should show 123 with second number "2" in red but it shows 12 3 with second number "2" in red. There is a space behind the colored number 2. The resulting html code looks like this: <p class="tightenable">2<font color="red">2</font> 2</p> Where is the function where i can change, that there is no line break after </font>? Please help, i search and search but i did'nt find the place. Thank you Stefan |
From: Arnaud F. <ar...@cr...> - 2005-11-29 16:32:55
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stefan wrote: > The resulting html code looks like this: > > <p class="tightenable">2<font color="red">2</font> > 2</p> OMG !!! Well ... the font element is not a great idea ... you'd better use span with an inline style or a class you define in your css file. <p class="tightenable">2<span style="color:#f00;">2</span>2</p> Arnaud -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDjILEyAf3wgFyy1ARAv3bAKDpy4rfEyNNzBc45/qGTi08vgmbjQCgyIlu gu1rMhOhaCavnlADsZxv8FQ= =41Ay -----END PGP SIGNATURE----- |
From: Stefan <son...@ba...> - 2005-11-29 16:57:01
|
May it's not a good idea but it's part of phpwiki InlineParser.php class Markup_color extends BalancedMarkup { // %color=blue% blue text %% and back to normal var $_start_regexp = "%color=(?: [^%]*)%"; var $_end_regexp = "%%"; function markup ($match, $body) { $color = substr($match, 7, -1); if (strlen($color) != 7 and in_array($color, array('red', 'blue', 'grey', 'black', 'green', 'yellow', 'darkgreen', 'darkblue'))) { // must be a name return new HtmlElement('font', array('color' => $color), $body); } elseif ((substr($color,0,1) == '#') and (strspn(substr($color,1),'0123456789ABCDEFabcdef') == strlen($color)-1)) { return new HtmlElement('font', array('color' => $color), $body); } else { trigger_error(sprintf(_("unknown color %s ignored"), $color), E_USER_WARNING); } } } Stefan Arnaud Fontaine schrieb: >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >Stefan wrote: > > > >>The resulting html code looks like this: >> >><p class="tightenable">2<font color="red">2</font> >>2</p> >> >> > >OMG !!! > >Well ... the font element is not a great idea ... you'd better use span >with an inline style or a class you define in your css file. > ><p class="tightenable">2<span style="color:#f00;">2</span>2</p> > >Arnaud >-----BEGIN PGP SIGNATURE----- >Version: GnuPG v1.4.2 (GNU/Linux) >Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org > >iD8DBQFDjILEyAf3wgFyy1ARAv3bAKDpy4rfEyNNzBc45/qGTi08vgmbjQCgyIlu >gu1rMhOhaCavnlADsZxv8FQ= >=41Ay >-----END PGP SIGNATURE----- > > >------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. Do you grep through log files >for problems? Stop! Download the new AJAX search engine that makes >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click >_______________________________________________ >Phpwiki-talk mailing list >Php...@li... >https://lists.sourceforge.net/lists/listinfo/phpwiki-talk > > > > |
From: Stefan <son...@ba...> - 2005-11-29 17:05:18
|
Ihave changed the code as following and made it with span class Markup_color extends BalancedMarkup { // %color=blue% blue text %% and back to normal var $_start_regexp = "%color=(?: [^%]*)%"; var $_end_regexp = "%%"; function markup ($match, $body) { $color = substr($match, 7, -1); if (strlen($color) != 7 and in_array($color, array('red', 'blue', 'grey', 'black', 'green', 'yellow', 'darkgreen', 'darkblue'))) { // must be a name return new HtmlElement('span', array('style' => 'color:'.$color), $body); } elseif ((substr($color,0,1) == '#') and (strspn(substr($color,1),'0123456789ABCDEFabcdef') == strlen($color)-1)) { return new HtmlElement('span', array('style' => 'color:'.$color), $body); } else { trigger_error(sprintf(_("unknown color %s ignored"), $color), E_USER_WARNING); } } } now it works thank you for the tip Stefan schrieb: > May it's not a good idea but it's part of phpwiki > > InlineParser.php > > class Markup_color extends BalancedMarkup { > // %color=blue% blue text %% and back to normal > var $_start_regexp = "%color=(?: [^%]*)%"; > var $_end_regexp = "%%"; > function markup ($match, $body) { > $color = substr($match, 7, -1); > if (strlen($color) != 7 > and in_array($color, array('red', 'blue', 'grey', 'black', > 'green', 'yellow', 'darkgreen', 'darkblue'))) { > // must be a name > return new HtmlElement('font', array('color' => $color), > $body); > } elseif ((substr($color,0,1) == '#') > and > (strspn(substr($color,1),'0123456789ABCDEFabcdef') == > strlen($color)-1)) { > return new HtmlElement('font', array('color' => $color), > $body); > } else { > trigger_error(sprintf(_("unknown color %s ignored"), > $color), E_USER_WARNING); > } > } > } > > Stefan > > Arnaud Fontaine schrieb: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Stefan wrote: >> >> >> >>> The resulting html code looks like this: >>> >>> <p class="tightenable">2<font color="red">2</font> >>> 2</p> >>> >> >> >> OMG !!! >> >> Well ... the font element is not a great idea ... you'd better use span >> with an inline style or a class you define in your css file. >> >> <p class="tightenable">2<span style="color:#f00;">2</span>2</p> >> >> Arnaud >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.2 (GNU/Linux) >> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org >> >> iD8DBQFDjILEyAf3wgFyy1ARAv3bAKDpy4rfEyNNzBc45/qGTi08vgmbjQCgyIlu >> gu1rMhOhaCavnlADsZxv8FQ= >> =41Ay >> -----END PGP SIGNATURE----- >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. Do you grep through >> log files >> for problems? Stop! Download the new AJAX search engine that makes >> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click >> _______________________________________________ >> Phpwiki-talk mailing list >> Php...@li... >> https://lists.sourceforge.net/lists/listinfo/phpwiki-talk >> >> >> >> > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Phpwiki-talk mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwiki-talk > > |
From: Arnaud F. <ar...@cr...> - 2005-11-29 18:07:35
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Great ! Adding a class 'red' to the span or, better, a more semantic name like 'essential', 'important', defining the class in the css file might be an even better solution. Stefan a =E9crit : > Ihave changed the code as following and made it with span > > class Markup_color extends BalancedMarkup { // %color=3Dblue% blue > text %% and back to normal var $_start_regexp =3D "%color=3D(?: > [^%]*)%"; var $_end_regexp =3D "%%"; function markup ($match, $body) > { $color =3D substr($match, 7, -1); if (strlen($color) !=3D 7 and > in_array($color, array('red', 'blue', 'grey', 'black', 'green', > 'yellow', 'darkgreen', 'darkblue'))) { // must be a name return new > HtmlElement('span', array('style' =3D> 'color:'.$color), $body); } > elseif ((substr($color,0,1) =3D=3D '#') and > (strspn(substr($color,1),'0123456789ABCDEFabcdef') =3D=3D > strlen($color)-1)) { return new HtmlElement('span', array('style' > =3D> 'color:'.$color), $body); } else { > trigger_error(sprintf(_("unknown color %s ignored"), $color), > E_USER_WARNING); } } } > > now it works thank you for the tip > > > Stefan schrieb: > >> May it's not a good idea but it's part of phpwiki >> >> InlineParser.php >> >> class Markup_color extends BalancedMarkup { // %color=3Dblue% blue >> text %% and back to normal var $_start_regexp =3D "%color=3D(?: >> [^%]*)%"; var $_end_regexp =3D "%%"; function markup ($match, >> $body) { $color =3D substr($match, 7, -1); if (strlen($color) !=3D 7 >> and in_array($color, array('red', 'blue', 'grey', 'black', >> 'green', 'yellow', 'darkgreen', 'darkblue'))) { // must be a name >> return new HtmlElement('font', array('color' =3D> $color), $body); >> } elseif ((substr($color,0,1) =3D=3D '#') and >> (strspn(substr($color,1),'0123456789ABCDEFabcdef') =3D=3D >> strlen($color)-1)) { return new HtmlElement('font', array('color' >> =3D> $color), $body); } else { trigger_error(sprintf(_("unknown >> color %s ignored"), $color), E_USER_WARNING); } } } >> >> Stefan >> >> Arnaud Fontaine schrieb: >> > Stefan wrote: > > > >>>>> The resulting html code looks like this: >>>>> >>>>> <p class=3D"tightenable">2<font color=3D"red">2</font> 2</p> >>>>> > > > > OMG !!! > > Well ... the font element is not a great idea ... you'd better use > span with an inline style or a class you define in your css file. > > <p class=3D"tightenable">2<span style=3D"color:#f00;">2</span>2</p> > > Arnaud >>> >>> - ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick _______________________________________________ Phpwiki-talk mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phpwiki-talk >>> >>> >>> >> >> >> >> ------------------------------------------------------- This >> SF.net email is sponsored by: Splunk Inc. Do you grep through log >> files for problems? Stop! Download the new AJAX search engine >> that makes searching your log files as easy as surfing the web. >> DOWNLOAD SPLUNK! >> http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick >> _______________________________________________ Phpwiki-talk >> mailing list Php...@li... >> https://lists.sourceforge.net/lists/listinfo/phpwiki-talk >> >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDjJjbyAf3wgFyy1ARAiLYAKCs6km8KbSwojtZhMZgt3Bu0LXFVwCgm2rC r/L/MGpJm1NYXVIgncJ6PZg=3D =3DwCXi -----END PGP SIGNATURE----- |
From: Stefan <son...@ba...> - 2005-11-29 18:42:14
|
I use this to add all different kind of styles to my phpwiki you can have a look here ... i don't know if it is usefull to make=20 classes for all the styles ... The syntax to use it is not really easy but we only need it very rarely. http://www.mineralienatlas.de/lexikon/index.php/Hilfe%20und%20Information= /Styles Thank you again Stefan Arnaud Fontaine schrieb: >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >Great ! > >Adding a class 'red' to the span or, better, a more semantic name like >'essential', 'important', defining the class in the css file might be >an even better solution. > >Stefan a =E9crit : > > =20 > >>Ihave changed the code as following and made it with span >> >>class Markup_color extends BalancedMarkup { // %color=3Dblue% blue >>text %% and back to normal var $_start_regexp =3D "%color=3D(?: >>[^%]*)%"; var $_end_regexp =3D "%%"; function markup ($match, $body) >>{ $color =3D substr($match, 7, -1); if (strlen($color) !=3D 7 and >>in_array($color, array('red', 'blue', 'grey', 'black', 'green', >>'yellow', 'darkgreen', 'darkblue'))) { // must be a name return new >>HtmlElement('span', array('style' =3D> 'color:'.$color), $body); } >>elseif ((substr($color,0,1) =3D=3D '#') and >>(strspn(substr($color,1),'0123456789ABCDEFabcdef') =3D=3D >>strlen($color)-1)) { return new HtmlElement('span', array('style' >>=3D> 'color:'.$color), $body); } else { >>trigger_error(sprintf(_("unknown color %s ignored"), $color), >>E_USER_WARNING); } } } >> >>now it works thank you for the tip >> >> >>Stefan schrieb: >> >> =20 >> >>>May it's not a good idea but it's part of phpwiki >>> >>>InlineParser.php >>> >>>class Markup_color extends BalancedMarkup { // %color=3Dblue% blue >>>text %% and back to normal var $_start_regexp =3D "%color=3D(?: >>>[^%]*)%"; var $_end_regexp =3D "%%"; function markup ($match, >>>$body) { $color =3D substr($match, 7, -1); if (strlen($color) !=3D 7 >>>and in_array($color, array('red', 'blue', 'grey', 'black', >>>'green', 'yellow', 'darkgreen', 'darkblue'))) { // must be a name >>>return new HtmlElement('font', array('color' =3D> $color), $body); >>>} elseif ((substr($color,0,1) =3D=3D '#') and >>>(strspn(substr($color,1),'0123456789ABCDEFabcdef') =3D=3D >>>strlen($color)-1)) { return new HtmlElement('font', array('color' >>>=3D> $color), $body); } else { trigger_error(sprintf(_("unknown >>>color %s ignored"), $color), E_USER_WARNING); } } } >>> >>>Stefan >>> >>>Arnaud Fontaine schrieb: >>> >>> =20 >>> > > =20 > >>Stefan wrote: >> >> >> >> =20 >> >>>>>>The resulting html code looks like this: >>>>>> >>>>>><p class=3D"tightenable">2<font color=3D"red">2</font> 2</p> >>>>>> >>>>>> =20 >>>>>> >> >>OMG !!! >> >>Well ... the font element is not a great idea ... you'd better use >>span with an inline style or a class you define in your css file. >> >><p class=3D"tightenable">2<span style=3D"color:#f00;">2</span>2</p> >> >>Arnaud >> =20 >> > > =20 > >>>> =20 >>>> >- ------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. Do you grep through log >files >for problems? Stop! Download the new AJAX search engine that makes >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick >_______________________________________________ >Phpwiki-talk mailing list >Php...@li... >https://lists.sourceforge.net/lists/listinfo/phpwiki-talk > =20 > >>>> =20 >>>> > > =20 > >>> >>>------------------------------------------------------- This >>>SF.net email is sponsored by: Splunk Inc. Do you grep through log >>>files for problems? Stop! Download the new AJAX search engine >>>that makes searching your log files as easy as surfing the web. >>>DOWNLOAD SPLUNK! >>>http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick >>>_______________________________________________ Phpwiki-talk >>>mailing list Php...@li... >>>https://lists.sourceforge.net/lists/listinfo/phpwiki-talk >>> >>> >>> =20 >>> > > >-----BEGIN PGP SIGNATURE----- >Version: GnuPG v1.4.1 (GNU/Linux) >Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org > >iD8DBQFDjJjbyAf3wgFyy1ARAiLYAKCs6km8KbSwojtZhMZgt3Bu0LXFVwCgm2rC >r/L/MGpJm1NYXVIgncJ6PZg=3D >=3DwCXi >-----END PGP SIGNATURE----- > > > >------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. Do you grep through log f= iles >for problems? Stop! Download the new AJAX search engine that makes >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick >_______________________________________________ >Phpwiki-talk mailing list >Php...@li... >https://lists.sourceforge.net/lists/listinfo/phpwiki-talk > > > =20 > |
From: Reini U. <ru...@x-...> - 2005-11-30 21:25:49
|
Stefan schrieb: > Ihave changed the code as following and made it with span > > class Markup_color extends BalancedMarkup { > // %color=blue% blue text %% and back to normal > var $_start_regexp = "%color=(?: [^%]*)%"; > var $_end_regexp = "%%"; > function markup ($match, $body) { > $color = substr($match, 7, -1); > if (strlen($color) != 7 > and in_array($color, array('red', 'blue', 'grey', 'black', > 'green', 'yellow', 'darkgreen', 'darkblue'))) { > // must be a name > return new HtmlElement('span', array('style' => > 'color:'.$color), $body); > } elseif ((substr($color,0,1) == '#') > and (strspn(substr($color,1),'0123456789ABCDEFabcdef') > == strlen($color)-1)) { > return new HtmlElement('span', array('style' => > 'color:'.$color), $body); > } else { > trigger_error(sprintf(_("unknown color %s ignored"), $color), > E_USER_WARNING); > } > } > } > > now it works thank you for the tip Ah, Stefan's first useful patch! Will be added. Thanks. |