Changeset 30324 for documentation


Ignore:
Timestamp:
2015-11-25T16:50:29+13:00 (8 years ago)
Author:
jmt12
Message:

Attempting a different fix to the issue with the plugin eating HTML comments when it shouldn't and subsequently screwing up the tabbed area. Replaced the pattern matching lookahead with a simple test to see whether we have encountered the comment tag inside a tabbed area but outside of a specific tab (which is the only time we suppress the HTML comment completely).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentation/trunk/wiki/plugins/simpletabs/syntax.php

    r30320 r30324  
    5454                                          $PARSER_MODES['paragraphs']);
    5555        // Init
    56         $this->debug = false;
     56        $this->debug = true; //false;
    5757        $this->divide_edit_section = false;
    5858        $this->tab_area_counter = 0;
     
    134134    $this->Lexer->addPattern('</TAB>', 'plugin_simpletabs');
    135135    // Hide comments always (sometimes used as separator)
    136     $this->Lexer->addPattern('^<!--.*?-->(?=\n)', 'plugin_simpletabs');
     136    $this->Lexer->addPattern('<!--.*?-->', 'plugin_simpletabs');
    137137    // Special things inside the content we want to manually handle.
    138138    $this->Lexer->addPattern( '^[ \t]*={2,6}\s?[^\n]+={2,6}[ \t]*(?=\n)', 'plugin_simpletabs');
     
    232232                                   'bytepos' => $pos + strlen($match)));
    233233      }
    234       if (preg_match('/^<!--(.*)?-->(?=\n)/s', $match, $matches))
     234      // note: we only handle comments inside tabbed area but outside of tabs
     235      if (empty($this->current_tab) && preg_match('/<!--(.*)?-->/s', $match, $matches))
    235236      {
    236237          $this->_debugPrint("Handler=>comment: " . htmlspecialchars($matches[1]));
     
    242243      if (preg_match('/(={2,6})\s*(.+?)\s*={2,6}/', $match, $matches))
    243244      {
     245          $this->_debugPrint("Handler=>header: " . htmlspecialchars($match));
    244246          $params = array();
    245247          $params['action'] = 'heading';
     
    264266    }
    265267
    266     return array();
     268    $this->_debugPrint("Unhandled: " . htmlspecialchars($match));
     269    return array(DOKU_LEXER_UNMATCHED, $match);
    267270  }
    268271
Note: See TracChangeset for help on using the changeset viewer.