Do these versions work together?

Missing argument 2 for Texy::protect(), called in /var/www/frteam.local/drupal/sites/frteam.local/modules/texy/lib/fshl.php on line 41 and defined in /var/www/frteam.local/drupal/sites/frteam.local/modules/texy/texy/libs/Texy.php on line 637.

It looks like $texy->protect is looking for a constant in the form of Texy::CONTENT_*, where the variants are block, replaced, markup, and textual. None of them seem to change the result, which is just an empty code block, literally:

<pre>code</pre>

Comments

havran’s picture

There is problem with changes in Texy! self. There is corrected fshlBlockHandler() function from lib/fshl.php file (for quick solution).

function fshlBlockHandler($invocation, $blocktype, $content, $lang, $modifier) {
  if ($blocktype !== 'block/code') {
    return $invocation->proceed();
  }

  $lang = strtoupper($lang);
  if ($lang == 'JAVASCRIPT') $lang = 'JS';

  $parser = new fshlParser('HTML_UTF8', P_TAB_INDENT);
  if (!$parser->isLanguage($lang)) {
    return $invocation->proceed();
  }
    
  $texy = $invocation->getTexy();
  $content = $texy->blockModule->outdent($content);
  $content = $parser->highlightString($lang, $content);
  $content = $texy->protect($content, TEXY_CONTENT_BLOCK); // or Texy::CONTENT_BLOCK in PHP 5

  $elPre = TexyHtml::el('pre');
  if ($modifier) $modifier->decorate($texy, $elPre);
  $elPre->attrs['class'] = strtolower($lang);

  $elCode = $elPre->create('code', $content);

  return $elPre;
}

Thank you for notice! :)

havran’s picture

Assigned: Unassigned » havran
Status: Active » Needs work

This solution working with Texy! 2 beta rev 180 and higher (http://texy.info/download)...

havran’s picture

Status: Needs work » Fixed

Please, wait for generate new nightly developmetnt release and test it. Here is changes:

- Patch #171869, #171856. Patch that integrates locale handling into Texy module. Thanks to adam.skinner.
- Bug #186418 -  fshl.php can not reflect changes in Texy! library
- New option in Texy! module settings. User can now enable or disable Texy! function which automaticaly insert &shy; entity into long words
- texy.compact.php is now into distribution, installation is now much easier and we avoid incompatibility between Texy! versions :)
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.