Loading...
 
Skip to main content

Category: Syntax highlighter (Codemirror)

Wiki Syntax highlighter (currently Codemirror)
Syntax highlighter (Codemirror)
Show subcategories objects

Name Type
12.x: can't post comments if codemirror is on (it says 'Content is empty')
12.x: can't post comments if codemirror is on (it says 'Content is empty'). This was working in 9.x.

Tried with jgui, codemirror on (default theme). Reproduced in a show.t.o instance for 12.x:
http://xavi-9794-5256.show.tikiwiki.org/tiki-index.php

Log in as:
u: admin
p: 12345
and try to ad a new comment.

When you click first to toggle highlighter (disable codemirror for that page and visit), then you can post the comment with no problem.

If this is too difficult to fix in codemirror implementation in Tiki, maybe some preferences would help to indicate in which section to have codemirror on (main text areas from wiki pages, trackers, etc), but disabled for comments, etc.
tracker item
codemirror not switchable for new comments (but just for comment edition) even if preference correctly set
13.x: codemirror not switchable for new comments (but just for comment edition) even if preference correctly set.
In 12.x, codemirror is switchable indeed for new comments, as well as for comment edition

{img fileId="798" thumb="y" rel="box[g]"}

You can see it reproduced here:
http://xavi-9794-5064.show.tikiwiki.org/tiki-index.php?page=HomePage&threadId=1&comzone=show#threadId1

u: admin
p: 12345
tracker item
13.x: Contents of Plugin Code shown twice when shown through an iframe (the Upgrade Wizard uses that to display some doc.t.o pages)
13.x: Contents of Plugin Code shown twice when shown through an iframe (the Upgrade Wizard uses that to display some doc.t.o pages, such as http://doc.tiki.org/Tiki13 and http://doc.tiki.org/Upgrade
tracker item
Allow end user to switch codemirror on in tracker field textareas when the site feature allows
When codemirror is on and its default mode is set to "Off (but switchable)", the end user expects to see a button available in tracker item textareas (like in dev.t.o/t5 bug tracker).

But it's not available still.

To see it reproduced:
Log in here:
http://xavi-9794-5064.show.tikiwiki.org/tiki-index.php?page=Contact_us&itemId=1
u: admin
p: 12345

Codemirror has been set to on (with default theme). If you edit the "Contact_us" page you'll see the content highlighted.
However, no highlighting in the tracker text area field.

Maybe the best option would be to allow the tracker admin to set an option for text areas to include the button to toggle the "highlighter" upon user request (as with text areas in wiki pages).
This way, codemirror could be set to "Disabled but switchable" (default preference in new installs), and each user could decide whether to enalbe highlighting in that text area or not (to prevent side issues in some cases with codemirror on, from happening always in all text areas, etc)
tracker item
Browser search fails to find some term occurences in CodeMirror text areas
Search offered by browsers (Ctrl+F) looks in text areas. So if editing a wiki page (for example), browser search should allow finding a term in the wiki page's source. Unfortunately, CodeMirror does not find terms reliably, in Tiki 17 as well as trunk (r63983).

It's not exactly clear when search works and when it doesn't, but apparently occurrences of the search term inside the visible zone will be found. Those outside will not necessarily though.

For example, searching for "Smarty templates" in https://dev.tiki.org/DevTips only finds 1 of 3 occurences if the editor is at its default positioning (top).

This affects at least Firefox 55.0.3 and Google Chrome 61.0.

I consider this a serious bug for CodeMirror.
tracker item
Codemirror buttons not shown in edit page at dev.t.o 12.x r48321
Dev.t.o has the Syntax highlighter enabled, with theme as: "Off (but switchable)"

I'm editing this page:
http://dev.tiki.org/tiki-editpage.php?page=Tiki12

as user xavi, with Chrome, and I can't see the button to switch the highlighter on.
---
Weird: after a while, the button is shown again. {sign user="xavi" datetime="2013-11-04T18:50:52+00:00"}
---
I can't reproduce it anymore. Who knows... Closing item.
tracker item
CodeMirror doesn't minify like everything else does
Do a view source of the show instance and you will see:

{CODE()}<script type="text/javascript" src="vendor/codemirror/codemirror/lib/codemirror.js"></script>{CODE}

Perhaps it's kept separate to be lazy-loaded when needed, but supplying a minified version of the file would be better.
tracker item
Codemirror is not showing links to switch the highlighter even if prefs is correctly set
Codemirror is not showing links to switch the highlighter even if the preference is correctly set to do so.

Tried using firefox and chrome, with my user "xavi" (no admin rights) and "xavidp" (admin rights): same effect.

The preference is still set as
Configuration Wizard > Set up Text Area > Syntax highlighter (CodeMirror) Theme > "Off (but switchable)"
tracker item
CodeMirror latest 12.x : Line numbering hides everything and puts huge line breaks
See video

This was discovered as part of {wish id=4728}
---
The same issue happens when you add line numbering in PluginCode sections.
Reproduced also here:
http://dev.tiki.org/Web-based+source+code+editor#Bugs
tracker item
CodeMirror problems
{syntax type="tiki" editor="plain"}
Following the code mirror upgrade recently in {commit id=48260} and despite several repairs by me {sign user="jonnybradley" datetime="2013-11-14T20:19:35+00:00"} it seems to be causing problems in several areas:
* --CODE plugins no longer do syntax highlighting-- (sort of fixed but looks messy {sign user="jonnybradley" datetime="2013-12-05T13:31:50+00:00"})
* Plugin popup edit textareas using codemirror (such as CODE) no longer show any text at all (that's the line numbering issue)
* Usable height of codemirror textareas in prefs admin pages such as tiki-admin.php?page=look&cookietab=6 is too short (or box too tall)
* Side by side translation totally messed up (possibly was before)

So should we revert r48260 and go back to codemirror 2.25 (although i have repaired some breakages, might be messy), or somehow fix all these things, or re-mark codemirror as experimental for 12.0 and hope to fix it better later?
tracker item
Codemirror: button to switch it on is hidden when first the editor is set to fullscreen
Codemirror: button to switch it on is hidden when first the editor is set to fullscreen

This was working in Tiki9.

To reproduce:
* Set codemirror feature to on, and mode to "Off (but switchable)"
* edit one wiki page with the plain text editor
+ notice that the button to "switch highlighter" is shown below the textarea. Do not click on it yet.
* click at full screen icon in the toolbar
+ notice that the button to "switch highlighter" is gone from the textarea surroundings

{flash type="url" movie="display683" width="778" height="654"}

----
Issue Still present on 06 February, 2014 15:02:50 CET- REV 49772. {sign user="xavi" datetime="2014-02-07T09:21:05+00:00"}
tracker item
CodeMirror: deduplicate Tiki mode code
Tiki mode is now part of CodeMirror:
https://github.com/marijnh/CodeMirror/tree/master/mode/tiki
http://codemirror.net/mode/tiki/

Be we also have a duplicate in Tiki code:
http://sourceforge.net/p/tikiwiki/code/HEAD/tree/trunk/lib/codemirror_tiki/mode/tiki/tiki.js
tracker item
CodeMirror: too much white space in wiki source view
See screencast of:
http://dev.tiki.org/tiki-pagehistory.php?page=Tiki+Slideshow+used+in+BigBlueButton&source=14

{flash type="url" movie="display561" width="664" height="528"}
tracker item
Comments to tracker items can't be posted when codemirror is on
Reproduced in trunk and 16.x:

Inability to post a comment-Issue (due to highlighter)
Reproduced in trunk in:
* Login as admin in http://xavi-9794-3214.show.tikiwiki.org/tiki-view_tracker_item.php?itemId=5
u: admin
p: 12345

And in 16.x in:
http://xavi-9794-6132.show.tikiwiki.org/tiki-view_tracker_item.php?itemId=5
u: admin
p: 12345

It's currently also affecting https://dev.tiki.org bug tracker comments. {sign user="xavi" datetime="2016-10-14T10:17:35+00:00"}

When codemirror highlighter is on (desired behavior in some setups, and the one produced by the new profile "Bug_Tracker_15" by default) when you click at submit your comment, you get: "__content is empty__", so you need to disable the highlighting before you can safely submit your comment.

This feature works as expected in Tiki15.
tracker item
Doc, Plugins, Codemirror; The colors parameter displayed as example don't do anything (anymore) code mirror disabled ?
At https://doc.tiki.org/PluginCode the different samples with colors parameters are not doing anything.
tracker item
Eval error in event debug console in IE
Just got an error in debugging console of IE10 when posting comment here:
{CODE()}
//Synchronize textarea and codemirror before comment is posted
$(".comment-form>form").submit(function(event){
var $textarea = event.target.find("textarea.wikiedit"); //retrieve the text area from the form that is submitted
if (typeof syntaxHighlighter.sync === 'function') {
syntaxHighlighter.sync($textarea);
}
});
{CODE}
It said something like -+"find method is not available here"+- (sorry it was in Czech and not copypasted with the code snipped here).

luci
tracker item
GeSHi - Generic Syntax Highlighter for PluginCode should be in mods (and activated on *.tw.o sites)
((doc:PluginCode)) doesn't show colors for php code, as it should according to doc page:
[http://doc.tikiwiki.org/PluginCode]
Tried with param colors=>php or colors=>phpcode:
{CODE()}
{CODE(colors=>php)}
/** Return system defined temporary directory.
* In Unix, this is usually /tmp
* In Windows, this is usually c:\windows\temp or c:\winnt\temp
* \static
*/
function tempdir() {
static $tempdir;
<b>$tempdir = '../tmp';</b>
<b>/*</b> if (!$tempdir) {
$tempfile = tempnam(false,'');
$tempdir = dirname($tempfile);
@unlink($tempfile);
} <b>*/</b>
return $tempdir;
}
}
{CODE}
{CODE}

And it returned:
{CODE(colors=>php)}
/** Return system defined temporary directory.
* In Unix, this is usually /tmp
* In Windows, this is usually c:\windows\temp or c:\winnt\temp
* \static
*/
function tempdir() {
static $tempdir;
$tempdir = '../tmp';
/* if (!$tempdir) {
$tempfile = tempnam(false,'');
$tempdir = dirname($tempfile);
@unlink($tempfile);
} */
return $tempdir;
}

}
{CODE}

---
Update: RFE for plugincode:
Why not using "wrap=>1" as default param instead as "wrap=>0"?
tracker item
inline syntax highlighting of CODE plugin
Syntax highlighting for PHP (and presumably other languages) does not appear to work at first glance. Upon further inspection, its clear that syntax hiliting within the CODE plugin expects a HTML file, rather than an inline code example. I propose a reversal of behavior to expecting an inline example.

Using this code:
{CODE()}
{CODE(colors="php")}
// this is a comment
basename($alpha);
{CODE}
{CODE}

This is output:
{CODE(colors="php")}
// this is a comment
basename($alpha);
{CODE}

On the other hand using this code:
Using this code:
{CODE()}
{CODE(colors="php")}
<?php
// this is a comment
basename($alpha);
{CODE}
{CODE}

The highlighting is now enabled, but its not really the right code example any more:
Using this code:
{CODE(colors="php")}
<?php
// this is a comment
basename($alpha);
{CODE}

Further reading:
[https://groups.google.com/forum/#!topic/codemirror/j7CsgZgM01c]
[http://codemirror.net/mode/php/index.html]
tracker item
Codemirror treats 2 hyphens used for an em-dash as a strikeout
Not working yet
tracker item
Keep color highlighting from PluginCode at the mpdf printed version
Keep color highlighting from PluginCode at the mpdf printed version

When you print a page with plugin code and color highlighting enabled (through codemirror), the mpdf produced page doesn't keep the colors.

Some code to easy copy & paste to any tiki 18.x install with mpdf:
https://dev.tiki.org/CodeMirror+Testing+v3

tracker item
Minify JavaScript breaks codemirror in doc.t.o 18.x
Minify JavaScript breaks codemirror in doc.t.o 18.x.
Once minify js is disabled in the performance control panel, syntax highlighting works again as expected.
I detected it comparing the settings in dev.t.o (where codemirror worked as expected) and doc.t.o (where it didn't; and codemirror modes dropdown, when attempting to change highlighter, showed "null").
HTH
tracker item
Multiple code plugins on a single WYSIWYG page not correctly parsed
When adding a single code plugin sectin onto a WYSIWYG page, everything is parsed and highlighted correctly. When adding a second code plugin section to that same page in the WYSIWYG editor, the first code plugin get "destroyed" - the XML tags in the code plugin etc are converted to &amp;lt; instead of <

This old mailing list thread describes the problem: http://tikiwiki.1073613.n5.nabble.com/Tiki-devel-Parser-problems-with-wysiwyg-td10967.html

Apparently this has not yet been fixed with Tiki 9.6
tracker item
PluginCODE: Colors picker regression
{img fileId="537"}
tracker item
rtl in codemirror 3.16: scrollbar on the right should disappear
branch 12.x nowadays uses codemirror 3.16 (3.x is supposed to be right-to-left language ready).

I tried with hebrew, and the editor shows an extra scrollbar on the right of the screen, which hides the firsts letters of each sentence starting on the right margin.
tracker item
Searching for content highlights the chosen language in search term text as well
Current behavior:
When searching for a term and selecting a language (for example German (DE)) the search results will highlight the searched languages letters (in our example "DE") as well.

{img fileId="1128" thumb="box"}

Expected behavior:
The search results only highlight the searched term and not the chosen language as well.

Step to reproduce:
Search any term in using the search module and the language filters.

{img fileId="1129" thumb="box"}

Possible workaround:
Disable the whole highlighting using CSS.
tracker item
  • «
  • 1 (current)
  • 2
Show PHP error messages