Skip to content

Commit

Permalink
Pass unmatched text through html_secedit() to get parsed wiki text fo…
Browse files Browse the repository at this point in the history
…r annotation.
  • Loading branch information
turnermm committed Jan 1, 2019
1 parent 76f210a commit c7c54ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion style.css
Expand Up @@ -7,7 +7,7 @@
display: none;
}
#anno_close {
min-width: 570px;
min-width: 590px;
background-color: #eee;
display: inline-block;
padding-left: 8px;
Expand Down
15 changes: 7 additions & 8 deletions syntax.php
Expand Up @@ -29,7 +29,7 @@ function getType(){
*/

function getPType(){
// return 'block';
return 'block';
}

/**
Expand Down Expand Up @@ -84,22 +84,21 @@ function handle($match, $state, $pos, Doku_Handler $handler){
* Create output
*/
function render($mode, Doku_Renderer $renderer, $data) {
//return false;

if($mode == 'xhtml'){
list($state, $xhtml) = $data;
switch ($state) {
case DOKU_LEXER_ENTER :
$tip = '<span class="annotation ui-widget-content '. $xhtml . '">';
$renderer->doc .= $tip;
break;
case DOKU_LEXER_UNMATCHED :
// msg(htmlentities($xhtml));
$renderer->doc .= '<span id="anno_close"><span class="anno_exit">close</span> </span>';
$renderer->doc .= htmlentities($xhtml); break;
case DOKU_LEXER_UNMATCHED :
$html = html_secedit(p_render('xhtml',p_get_instructions($xhtml),$info),$secedit);
$renderer->doc .= '<span id="anno_close"><span class="anno_exit">close</span> </span>';
$renderer->doc .= $html;
case DOKU_LEXER_EXIT :
$renderer->doc .= "</span>"; break;
case DOKU_LEXER_SPECIAL:
// msg(htmlentities($xhtml));
case DOKU_LEXER_SPECIAL:
list($which,$text)= explode('>',$xhtml);
$title = 'anno_' .$which;
$renderer->doc .= '<span class="anno" title="' .$title.'">' .htmlentities($text).'</span>'; break;
Expand Down

0 comments on commit c7c54ad

Please sign in to comment.