Fork me on GitHub

content 3.1.0 and scribite 4.1 - html display problem  Bottom

  • I was using scribite to create content. It looks any text within a span (and a few other tags such as address and sub) will not be displayed correctly. The problem is < and > get replaced with

    Code

    &lt; and &gt;
    . e.g. if I make some italicized text hello kitty in the editor the HTML code

    Code

    &lt;span style=&quot;font-style: italic;&quot;&gt;hello kitty&lt;/span&gt;
    will be displayed instead when the created page is viewed. I tried both xinha and openwysiswygt and made sure the HTML saving option was selected. I tried to save the content as text and even disabled the wysiswygt editors and entered the HTML code as plain text. It does not seem to make a difference. I checked the saved data in the database, < and > were correctly stored without being replaced with their HTML entities.

    So it looks like the problem is in the rendering in the content module and doesn't have anything to do with the editors? What could it be? Could it be my browser instead? I'm using firefox 3.0 on a Fedora 10 box. I should mention that some simple HTML tags such as b and p, even strong, do work fine.



    edited by: xizhou, datetimebrief
  • You need to allow the tags in the HTML settings. These can be found in admin/security/security centre.

    --
    David
  • Thanks David. You're exactly correct.

    Nevertheless I still have problems using scribite with content. Scribite is convenient in formatting my input, but the created content may not display as it looks in the wysiswygt editor because some js and CSS files used by the editor's plugins may not be loaded when the created content is viewed. For instance I was writing some equation using xinha's equation plugin, which uses ASCIIMathML.js (included in xinha's equation plugin) to format my equation so what I wrote appears as equations in the xinha editor. Unfortunately when I view the content created, ASCIIMathML.js is no longer loaded (because xinha is not called when viewing the content) and the equations display as raw ascii.

    Is there a simple way to deal with this? It's probably more of an editor issue and it seems my only option is to somehow include the needed js and CSS manually in the site's main content.
  • I haven't used such kind of plugins.

    Take a look at the plugin description at http://xinha.webfact…l.com/wiki/Equation

    As I understand it, you need to load "/Equation/ASCIIMathML.js" in your templates after the part with the config vars.
    Try it.

    I there is something I can add to scribite!/Xinha itself let me know :)

    Sven

    --
    | scribite! | TNGz | piwik | zweet |
  • Hi Sven,

    I think xizhou is talking about the same issue we already talked about: How to implement the CSS of the theme in scribite!. I've configured xinha to use the CSS of the theme, but you told me it is dangerous because some CSS may break something in xinha. Therefore we have to use the editor.css which is not loaded in my case.

    --
    webmaster of gvoh.de and pggo.de

    project manager of new module media repository
  • Actually, loading of a .js file is at issue with what Sven responded to, and I would expect that his diagnosis is correct.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • Hi guys, thanks a bunch for trying to be helpful. I think I understand what you said. Just in case my exact issue would be useful to you and others, let me elaborate on what I was asking a little bit more.

    I was writing an equation with xinha equation plugin, say the formula for the area of a circle, area = pi times radius squared. In xinha editor, it appears just like the equation in a math textbook (this is what wysiswyg is supposed to mean anyway, at least for the wys part), thanks to ASCIIMathML.js that comes with the xinha equation plugin (the js is loaded when the xinha plugin is called). The equation was stored in the DB (the content table of module content) as

    Code

    <span class="AM">`A=pi*r^(2)`</span>
    . So far so good.

    The problem arises when I tried to view the content I created (by calling the display or view function in the content module). What I see is the raw text `A=pi*r^(2)` instead of the beautiful equation in xinha editor. So what I get isn`t exactly what I saw. This is understandable: when I view the created content by calling a func in the content module, the js and CSS loaded are those in the system and the current module in use, content. ASCIIMathML.js is not included because it is in xinha plugin dir (/javascript/scribite_editors/xinha/plugins/Equation/ in my system).

    So in order to make the equation display correctly I need to have ASCIIMathML.js somehow loaded when I view the created content (and xinha not loaded), as Sven suggested. This is unfortunately not very convenient to do in my case because I was using the content module to view and not putting the content in a template file written by myself where I can always simply use pageutil::addvar to load the needed js.

    As far as I see there is no good solution to this, though my wish would be that scribite be smart enough to realize a js or CSS specific to a used editor plugin is missing from the system definition and then somehow include it in the created and saved content (This is probably next to impossible for security reasons).
  • scribite! loads on every page request (also without an editor loaded, because it checks if an editor is needed for the current module function).

    So a check would be possible (theoretical).

    But I think it's not very good. scribite! has to check on every page request for the activated plugins. That is not very good in the performance view.
    If you use such special plugins you have to read the documentation of that and integrate the needed things like js and so on I think.
    Correct me if I am wrong.

    The modifications of editor layout is described and can be done in /pnconfig/xinha/editor.css. Easily.

    --
    | scribite! | TNGz | piwik | zweet |
  • the solution I am thinking of would require enabling the script tag as well, and depending on your number of users/type of site you might not want to do that... none the less:

    if you went into source view after you had typed up what you want, and added the call to the .js in the head portion of that article/post might it just load that .js for just that post? no hit to search for the used .js just tell it to load for that post.
  • No this isn't a good idea ... enabling the script tag is simply too dangerous. Plus it'll be stripped off by FormUtil::getPassedValue when your input is read anyway.

    I don't think there's an easy solution, just remind you be careful with the script tag icon_biggrin

    TakeIT2

    the solution I am thinking of would require enabling the script tag as well, and depending on your number of users/type of site you might not want to do that... none the less:

    if you went into source view after you had typed up what you want, and added the call to the .js in the head portion of that article/post might it just load that .js for just that post? no hit to search for the used .js just tell it to load for that post.

This list is based on users active over the last 60 minutes.