Adding some extension mapping to FileUtil
Fixing wiki page update preview
This commit is contained in:
parent
0e0b7469d7
commit
8a046e3c7e
@ -38,7 +38,7 @@ class IDF_FileUtil
|
|||||||
'skin', 'sln', 'svc', 'vala', 'vb', 'vbproj', 'vbs', 'wsdl', 'xhtml',
|
'skin', 'sln', 'svc', 'vala', 'vb', 'vbproj', 'vbs', 'wsdl', 'xhtml',
|
||||||
'xml', 'xsd', 'xsl', 'xslt');
|
'xml', 'xsd', 'xsl', 'xslt');
|
||||||
|
|
||||||
public static $map = array("h" => "cpp", "hpp" => "cpp", "rc"=>"text", "sh"=>"bash", "cs"=>"csharp");
|
public static $map = array("cxx" => "cpp", "h" => "cpp", "hpp" => "cpp", "rc"=>"text", "sh"=>"bash", "cs"=>"csharp");
|
||||||
|
|
||||||
public static $syntaxhighlightext = array("as3", "cf", "cpp", "c", "css", "pas", "diff", "patch", "erl", "java", "jfx", "js", "pl", "php", "py", "rb", "sass", "scss", "scala", "sql", "vb", );
|
public static $syntaxhighlightext = array("as3", "cf", "cpp", "c", "css", "pas", "diff", "patch", "erl", "java", "jfx", "js", "pl", "php", "py", "rb", "sass", "scss", "scala", "sql", "vb", );
|
||||||
|
|
||||||
@ -63,6 +63,7 @@ class IDF_FileUtil
|
|||||||
*/
|
*/
|
||||||
public static function highLight($fileinfo, $content)
|
public static function highLight($fileinfo, $content)
|
||||||
{
|
{
|
||||||
|
|
||||||
$pretty = '';
|
$pretty = '';
|
||||||
if (self::isSupportedExtension($fileinfo[2])) {
|
if (self::isSupportedExtension($fileinfo[2])) {
|
||||||
$pretty = ' prettyprint';
|
$pretty = ' prettyprint';
|
||||||
@ -83,7 +84,8 @@ class IDF_FileUtil
|
|||||||
$ext = self::$map[$fileinfo[2]];
|
$ext = self::$map[$fileinfo[2]];
|
||||||
else
|
else
|
||||||
$ext = "text";
|
$ext = "text";
|
||||||
$content = '<script type="syntaxhighlighter" class="brush: ' . $ext . '">' . $content . '</script>';
|
|
||||||
|
$content = '<div id="highlight"><script type="syntaxhighlighter" class="brush: ' . $ext . '">' . $content . '</script></div>';
|
||||||
return Pluf_Template::markSafe($content);
|
return Pluf_Template::markSafe($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
{if $preview}
|
{if $preview}
|
||||||
<h2 id="preview" class="top">{trans 'Preview of the Page'}</h2>
|
<h2 id="preview" class="top">{trans 'Preview of the Page'}</h2>
|
||||||
{$preview}
|
|
||||||
{markdown $preview, $request}
|
{markdown $preview, $request}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user