HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[Fixed]Convert XHTML to Comcode

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#68476 (In Topic #14549)
Avatar

Community saint

Checked or Unchecked? Causes different problems

The "Site Option" Convert XHTML to Comcode has the following note:
Whether the WYSIWYG editor should try and convert HTML to Comcode, and also clean-up markup. If you use the WYSIWYG editor with huge documents and experience time-outs you should disable this option. By keeping this option you will get somewhat-readable Comcode markup out of the WYSIWYG editor.


If it is kept unchecked, comcode such as

Code

[youtube][/youtube]
will not be working on the WYSIWYG editor, but it won't mess with my 'comcode" pages when editing, even when "WYSIWYG" is disabled. I have use several custom concode pages for my virtual classroom site and adding new ones frequently. I'm not proficient enough with comcode to use it 100%, so it is interspersed with XHTML and even HTML. I have to be careful and add

Code

on every page. However, I found out to my despair that enabling: Convert XHTML to Comcode does a bad number (links are destroyed, formatting is basically gone) to my pages even when "WYSIWYG" is disabled. My pages cannot be fixed until the check-mark is removed.

My question is: How can I satisfy both my members need to use comcode shortcuts and be able to edit my pages without having every-time to uncheck the "comcode conversion"?

Example of code conversion FROM original:

PHP code

[semihtml]"{$CUSTOM_BASE_URL*}/themes/{$THEME*}/cool2.swf"[/semihtml]


TO Converted:

PHP code

[html]"%7B$CUSTOM_BASE_URL*%7D/themes/%7B$THEME*%7D/cool2.swf"[/html]

This is a similar phenomena as to what is happening to a forum post intermittently on URL links.


Last edit: by Jean
Back to the top
 
Posted
Rating:
#68480
Avatar

Please post as many exact test cases of poor Comcode version you can. Maybe put the WYSIWYG editor's HTML source into a .txt file for each case, and then attach a zip. That makes it very easy for me to fix them all.

I'll look into the case posted here.

There's another code hint you can use:

Code

{$,page hint: no_smart_conversion}

But I do want to fix the bugs.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#68481
Avatar

Community saint

OK, Chris!

I see your point, and I'll PM my code to you and the effect of conversion, but later this week as I'm in between classes right now.

Thanks

Jean
Back to the top
 
Posted
Rating:
#68486
Avatar

Right, I'm going to post two posts for clarity now. One will be about if Comcode conversion is on, and one if it is not.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#68487
Avatar

If Comcode conversion is off, it should be a non-issue. The processing model is far simpler, because it's giving you that simple directness with some loss to tidyness and quality of your content markup.

So I could find no way to reproduce the 'youtube' issue (but if it is a real bug, a .txt text case of WYSIWYG editor view-source would help).

There are two caveats though…

  1. In 6.0.3 we fixed a design flaw whereby if users without the "Subject to a more liberal HTML filter" permission used the WYSIWYG then the Comcode conversion would not happen if disabled. It's not quite a 'bug' as that is what is configured, but it led to their posts essentially coming out blank as they were in HTML and they weren't permitted that. So in 6.0.3 we forced conversion for users without the "Subject to a more liberal HTML filter" permission even if it was disabled in the configuration.
  2. In 6.1 we fixed a bug whereby the new WYSIWYG editor would put some spaces in as non-breaking-spaces, which the Comcode parser would not recognise. i.e. invalid Comcode like [youtube foo="bar"]...[/youtube]



Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#68488
Avatar

Ah, unfortunately I cannot reproduce the issue when conversion is on either.

There have been lots of bugs here in the past, because the conversion code is incredibly complex. It tries to remove all kinds of junk that gets put in by things like Microsoft Word, the web browser's own editor, or by virtue of the fact that a non-visual editor can lead to some bizarre code when users overlay styles on top of styles on top of styles.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#68583
Avatar

Community saint

I've since upgraded to ver. 6.1 and went through the same tests again and this time, I'm happy to report that most issues have been resolved once more with your magic wand (read, hard work).

The youtube comcode now works with or without XTML to comcode conversion enabled.

The comcode page editor with the comcode conversion enabled, no longer changes HTML tags when told to ignore the smart_conversion.

The only issue left is with the attachments being modified during previews: (see attached source code)

Code

**************************************************************
First inline attachment:<br />

<span class="ocp_keep">[attachment_safe thumb=&quot;0&quot;]new_1[/attachment_safe]</span><br />
<br />
Second inline attachment<br />
<span class="ocp_keep">[attachment_safe thumb=&quot;0&quot;]new_2[/attachment_safe]</span><br />
**************************************************************

Code

After second preview:

First inline attachment:<br />

<script type="text/javascript">// <![CDATA[
    var te_4522_27424=".../data/attachment.php?id=291&keep_fatalistic=1";
//]]></script><a href=".../data/attachment.php?id=291&amp;keep_fatalistic=1&amp;keep_session=7672906&amp;for_session=4fe3a4685f95ce7f254e41e233e2ebd4" target="_blank" title=" (this link will open in a new window)"><img alt="3 views (548 Bytes)" class="no_alpha attachment_img" id="te_4522_27424" src=".../data/attachment.php?id=291&amp;keep_fatalistic=1&amp;keep_session=7672906&amp;thumb=1&amp;keep_fatalistic=1&amp;keep_session=7672906&amp;for_session=4fe3a4685f95ce7f254e41e233e2ebd4" title="" /></a><br />
<br />

Second inline attachment<br />

<script type="text/javascript">// <![CDATA[
    var te_4522_10241=".../data/attachment.php?id=292&keep_fatalistic=1";
//]]></script><a href=".../data/attachment.php?id=292&amp;keep_fatalistic=1&amp;keep_session=7672906&amp;for_session=4fe3a4685f95ce7f254e41e233e2ebd4" target="_blank" title=" (this link will open in a new window)"><img alt="3 views (1.90 Kb)" class="no_alpha attachment_img" id="te_4522_10241" src=".../data/attachment.php?id=292&amp;keep_fatalistic=1&amp;keep_session=7672906&amp;thumb=1&amp;keep_fatalistic=1&amp;keep_session=7672906&amp;for_session=4fe3a4685f95ce7f254e41e233e2ebd4" title="" /></a>
****************************************************************

Code

Posting without preview

First:<br />

<img alt="" class="no_alpha attachment_img" id="te_473_23994" src=".../data/attachment.php?id=293&amp;keep_fatalistic=1&amp;keep_session=7672906&amp;thumb=0&amp;keep_fatalistic=1&amp;keep_session=7672906&amp;for_session=4fe3a4685f95ce7f254e41e233e2ebd4" title="" /><br />
<br />

Second:<br />

<img alt="" class="no_alpha attachment_img" id="te_473_29604" src=".../data/attachment.php?id=294&amp;keep_fatalistic=1&amp;keep_session=7672906&amp;thumb=0&amp;keep_fatalistic=1&amp;keep_session=7672906&amp;for_session=4fe3a4685f95ce7f254e41e233e2ebd4" title="" />
***************************************************************
After Preview:

Saved without preview
Back to the top
 
Posted
Rating:
#68601
Avatar

Thanks, fixed.

Attachment
sources/comcode_from_html.php
» Download: comcode_from_html.php (46 Kb, 78 downloads so far)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#68617
Avatar

Community saint

Thank you Chris for this important Fix!

It is working great and allows for multiple attachments types to retain their format and coexist peacefully on the same page.

Cheers!:thumbs::)
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: