Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

code tag in editor

Last updated on 1 year ago
D
deadwoodAROS Dev
Posted 1 year ago
Hi,

I noticed two problems with /code/ tag in editor:

1) It kills white space formatting, while it should preserve it as code should have correct indentation
2) It tried to color the code by some logic, but it looks suspicious

See comparison:

https://ae.amigal...c=1063.375

https://www.arosw...ad_id=1116
amigamiaamigamiaAdmin
Posted 1 year ago
OK Thanks for reporting it. Let me do some testing and research. It's built-in PHPFusion CMS so I'll have to see if this is a known problem.
amigamiaamigamiaAdmin
Posted 1 year ago

$default = [
 'title' => $locale['errunk'],
 'status' => '505',
 'back' => [
 'url' => BASEDIR.'index.php',
 'title' => $locale['errret']
 ]
];
Edited by amigamia on 29-08-2023 21:18, 1 year ago
M
magoriumSoftware Dev
Posted 1 year ago
as text is enclosed by code is text


 program hello;
 begin
 writeln('hello world&#039<img class='smiley' style='width:20px;height:20px;' src='../../images/smiley/wink.svg' alt='Wink'>;
 end.


as text is enclosed by pre
[pre]
program hello;
begin
writeln('hello world'Wink;
end.
[/pre]

Not to mention the preview window when you are trying to edit some code in order to preview the results. It is cut off at the right on my setup and the whole message box is highlighted for me with a white background.
amigamiaamigamiaAdmin
Posted 1 year ago
The indentation and the cut off are a bugs of the TinyMCE editor I am afraid. I will have to report that to the developers and see if there is a work around.

As for the white background in the preview, that is theme specific. I think it can be fixed. I just need to find the right color codes in the theme to adjust them.
D
deadwoodAROS Dev
Posted 1 year ago
Hmm, maybe there is an option to install another/additional editor? I remember seeing some forums that had two editors to choose from.

Edit: something I found on topic: https://stackover...to-tinymce
Edited by deadwood on 16-08-2023 08:36, 1 year ago
amigamiaamigamiaAdmin
Posted 1 year ago

deadwood wrote:

@deadwood - Hmm, maybe there is an option to install another/additional editor? I remember seeing some forums that had two editors to choose from.

Edit: something I found on topic: https://stackover...to-tinymce


There is an option to turn it off but I do not see an alternative in the Admin panel. I can try turning it off but I am not sure of the impact.

Great find on stackoverflow, I want to test it first. I am setting up a LAMP server to install PHP-Fusion and do some testing for both options.
amigamiaamigamiaAdmin
Posted 1 year ago
So I installed a LAMP and set the whole PHP-Fusion up on a local computer. I also found where the tinyMCE.init is and tried to disable the paste plugin but it's not making any difference.

Looks like there are other people with this problem and seems to be associated with tinyMCE.

I am still playing and testing for now. Hopefully I get a breakthrough soon because it is annoying.
D
deadwoodAROS Dev
Posted 1 year ago
Thanks for working on this. Indeed it's quite annoying.
amigamiaamigamiaAdmin
Posted 1 year ago

deadwood wrote:

@deadwood - Thanks for working on this. Indeed it's quite annoying.


So it's not the tinyMCE editor which is only when submitting news. The forums in here use BB codes and in particular the BB code code plugin. That is not a duplicate Smile

Looking into the javascript code to see if I can figure it out. Anyone good with Javascript in here?

https://prismjs.com/
Edited by amigamia on 31-08-2023 17:08, 1 year ago
amigamia attached the following file:
bbcode_code_plugin.zip [22.52kB / 301 Downloads]
D
deadwoodAROS Dev
Posted 1 year ago
One thing I noticed is that when I hit preview with [code] tag, then the indentation is preserved and text is not colored. It actually looks acceptable for what I need. Only when the post is submitted the indentation is lost.

Also looking at this reference: https://www.php-f...erview.php
There is an alternative "geshi" code which seems to take language as parameter. I tried setting it to "python" (where indentations are super important), but still the spaces where eaten :/ Maybe this "geshi" element is something easier to adjust?
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
Moderator: Administrator
Users who participated in discussion: amigamia, magorium, deadwood
Sign In
Not a member yet? Click here to register.
Forgot Password?
Users Online Now
Guests Online 20
Members Online 0

Total Members: 268
Newest Member: ajfa
Member Polls
Should AROSWorld continue with AROS-Exec files (SMF based)?
Yes44 %
44% [12 Votes]
No26 %
26% [7 Votes]
Not sure30 %
30% [8 Votes]