Texy2 beta and fshl 0.4.19 no highlight and throws errors

dingbats - October 25, 2007 - 01:55
Project:Texy!
Version:5.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:havran
Status:closed
Description

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>

#1

havran - October 25, 2007 - 06:07

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

<?php
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! :)

#2

havran - October 25, 2007 - 06:09
Assigned to:Anonymous» havran
Status:active» needs work

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

#3

havran - October 25, 2007 - 19:09
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 :)

#4

Anonymous - November 12, 2007 - 22:42
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.