« Project home page
my little forum
Log in
Register
Search:
Back to the entry by Micha
Post reply
Reply to the message by
Micha
Name:
E-mail:
(optional, won't be displayed directly)
Leave this field empty:
Homepage:
(optional)
Leave this field empty:
Location:
(optional)
Remember me (cookie)
Category:
General
Project organisation
Technics
Design/Themes
Features
Development
Todo
Bugs
German / Deutsch
Spanish / Español
French / Français
Accessibility/UX
Subject:
Formatting help
skip to input
format text bold
[b]bold text[/b]
format text italic
[i]italic text[/i]
insert hyperlink
[link=http://example.com/]link text[/link] / [link]http://example.com/[/link]
set text color
[color=#rgb]colored text[/color]
font size
[size=small]small text[/size]
[size=large]large text[/size]
insert list
[list][*]list item[/list]
insert image
[img]http://example.com/image.jpg[/img]
left: [img=left]http://example.com/image.jpg[/img]
right: [img=right]http://example.com/image.jpg[/img]
thumbnail: [img=thumbnail]http://example.com/image.jpg[/img]
thumbnail left: [img=thumbnail-left]http://example.com/image.jpg[/img]
thumbnail right: [img=thumbnail-right]http://example.com/image.jpg[/img]
upload image
upload image ...
insert TeX code
[tex]TeX code[/tex]
insert code
[inlinecode]code[/inlinecode]
[code]code[/code]
[code=css]code[/code]
[code=html]code[/code]
[code=javascript]code[/code]
[code=perl]code[/code]
[code=php]code[/code]
[code=sql]code[/code]
[code=xml]code[/code]
:-)
;-)
:-P
:-D
:-|
:-(
:yes:
:no:
:ok:
:lol:
:lol2:
:lol3:
:cool:
:surprised:
:angry:
:crying:
:waving:
:confused:
:lookaround:
:clap:
:love:
:tick:
Message:
> Hello, > > > So yes, the feature in the SelfHTML-forum is made with JavaScript but maybe not with Ajax/Fetch. > > To complete the description: this doesn't include code highlightning (because it is made on the server side (PHP lib GesHi)) but it should be able to parse the rest of the BB-codes. > > At SELFHTML, syntax is highlighted in the preview. So, yes, it is possible to convert Geshi to JavaScript but I cannot believe that redundant code (PHP and JS) is used. So, I think the code is generated by the server and added via JavaScript. However, this is not the point for the proposal but maybe for the implementation... > > > [1]: I personally don't like the list implementation because it adds [inlinecode]<br />[/inlinecode] after closing [inlinecode]</li>[/inlinecode]. This seems to be a limitation of the BB-code-parser-class or a misconfiguration > > Maybe it is incomplete. If one compares the [link=http://christian-seiler.de/projekte/php/bbcode/doc/de/kapitel9.php]example code[/link] given in the documentation and our implementation there are some differences. > > Documentation: > [code=php]$bbcode->addParser ('list', 'bbcode_stripcontents'); > $bbcode->addCode ('list', 'simple_replace', null, array ('start_tag' => '<ul>', 'end_tag' => '</ul>'), > 'list', array ('block', 'listitem'), array ()); > $bbcode->addCode ('*', 'simple_replace', null, array ('start_tag' => '<li>', 'end_tag' => '</li>'), > 'listitem', array ('list'), array ()); > $bbcode->setCodeFlag ('*', 'closetag', BBCODE_CLOSETAG_OPTIONAL); > $bbcode->setCodeFlag ('*', 'paragraphs', true); > $bbcode->setCodeFlag ('list', 'paragraph_type', BBCODE_PARAGRAPH_BLOCK_ELEMENT); > $bbcode->setCodeFlag ('list', 'opentag.before.newline', BBCODE_NEWLINE_DROP); > $bbcode->setCodeFlag ('list', 'closetag.before.newline', BBCODE_NEWLINE_DROP);[/code] > > our implementation > [code=php] $bbcode->addParser ('list', 'bbcode_stripcontents'); > $bbcode->addCode ('list', 'simple_replace', null, array ('start_tag' => '<ul>', 'end_tag' => '</ul>'), 'list', array ('block', 'listitem', 'quote', 'rtl', 'ltr'), array ()); > $bbcode->setCodeFlag ('list', 'paragraph_type', BBCODE_PARAGRAPH_BLOCK_ELEMENT); > $bbcode->setCodeFlag ('list', 'closetag.after.newline', BBCODE_NEWLINE_IGNORE); > $bbcode->setCodeFlag ('list', 'opentag.before.newline', BBCODE_NEWLINE_DROP); > $bbcode->setCodeFlag ('list', 'closetag.before.newline', BBCODE_NEWLINE_DROP); > $bbcode->addCode ('*', 'simple_replace', null, array ('start_tag' => '<li>', 'end_tag' => '</li>'), 'listitem', array ('list'), array ()); > $bbcode->setCodeFlag ('*', 'closetag', BBCODE_CLOSETAG_OPTIONAL); > // $bbcode->setCodeFlag ('*', 'paragraphs', true);[/code] > > /Micha
E-mail notification on reply of this posting
OK - Submit
Preview