Reports: Formatting unreliable - often HTML tags displayed instead !

I just generated a report of my entire library (of my current project): ~ 212 citations (plus attachments & notes).

Trouble is:

the formatting seems to be mostly _un_supported, and instead of correct formatting I get my notes interspersed with html code displayed...

Tried in FF & Chromium: same result.

Since I've made extensive use of formatting in my notes, and I've used Zotero's notes extensively, this amounts to nothing less than pain & disappointment...

Here's what most of my notes look like:

<ul>
<li> bla bla bla

<span style="text-decoration: underline;">
<em> another bla bla bla </em>
</span>.<br /><br />

Most of my notes have bullets & indents; however, some notes _are_ displayed correctly, but _why_ remains mysterious to me: those "correct" notes appear _randomly_ in the >200 page html document, and some of those do feature bullets, others don't.

What the?

Help & insights much appreciated :)

ps: also just had a look at the html source code (of that report) and could find no irregularity comparing notes where the formatting is (interpreted and) displayed correctly, and where it is _not_. Plz let me know if you need further details, thx!
«1
  • tried "tidy html" on the report html (tidy -f errs.txt -m index.html, http://sourceforge.net/projects/tidy/) but that didn't help...
  • Can you provide the HTML source for a (short, ideally) note that doesn't render as HTML? You can post it within <code> tags here.
  • ox
    edited April 26, 2012
    Ah, found something! though I'm not quite there yet:

    (...)
    <th>Date Added</th> <td>Wed
    04 Apr 2012 10:39:25 CEST</td>
    </tr> <tr> <th>Modified</th>
    <td>Wed 04 Apr 2012
    10:41:43 CEST</td> </tr>
    </tbody></table><h3 class="tags">Tags:</h3> <ul class="tags">
    <li>bla</li> <li>bliii</li> <li>bliasdv</li>
    <li>bluuuuuuu</li> </ul> <h3 class="notes">Notes:</h3>
    <ul class="notes"> <li
    id="i301"> <p>bla bla</p> </li>
    <li id="i395"> <p
    class="plaintext">&lt;ul&gt; &lt;li&gt; bla blabla
    blabla bla
    (...)

    where special emphasis ought to be placed on:

    <p class="plaintext">&lt;ul&gt; &lt;li&gt; bla blabla
    blabla bla


    and narrowed down further still on:

    &lt;ul&gt; &lt;li&gt;

    or

    &#38;&#108;&#116;&#59;&#117;&#108;&#38;&#103;&#116;&#59;&#10;&#38;&#108;&#116;&#59;&#108;&#105;&#38;&#103;&#116;&#59;

    instead of correctly _interpreting_ it as html in the form of
    <ul> <li>

    or

    &#60;&#117;&#108;&#62;&#32;&#60;&#108;&#105;&#62;

    and displaying it in the browser (FF, etc) as a bog-standard bullet or bulletted list...

    Perhaps

    class="plaintext"

    is the culprit? however, zapping it away with firebug didn't do the trick (yet)... who or what told z to render that note in bl***y plaintext?

    So why are these html tags not encoded (?) properly??? And why only on every other note in my long report?

    Any ideas?
  • ox
    edited April 26, 2012
    ps: I used http://www.addressmunger.com/display_code/ to generate code for the above...
  • ox
    edited April 26, 2012
    seem to have fellow sufferers:

    http://forums.zotero.org/discussion/21333/html-formatting-shows-up-in-notes-in-generated-repors/

    I'd even be happy to find a script to clean my "faulty" report, needn't be a zotero-internal fix.

    Could even do a laborious find-n-replace routine, but would consider that close to worst-case............
  • ox
    edited April 26, 2012
    got a hunch: back to basic html 101: isn't it _forbidden_ to have list tags _within_ a

    <p> bla </p>

    paragraph ?!?
  • ox
    edited April 26, 2012
    removed the <p> tags (around the faulty stuff) in firebug on the fly and voilá: neatly formatted text displayed.

    so my hunch: obvious bug in zotero ?
  • ox
    edited April 26, 2012
    still stuck: removed all relevant 155 <p> tags, but still get faultiness displayed... feel I'm only scratching the surface... why did it work with firebug (for one paragraph)? what's the root cause?

    need help!
  • edited April 26, 2012
    Dan or Simon will give the real response (I'm just kibitzing here); but ... this is probably not due to Zotero's own code, but rather the third-party embedded editor (tincyMCE) used for notes.
  • :-(

    guess that means a quick-fix let alone a real sound solution is gonna take quite a while to come by....?

    ;-(
  • edited April 26, 2012
    We need the full HTML contents of the note, not an excerpt. Something in the markup is triggering plaintext mode for the note in the Zotero report, but I can't see what that is without seeing the full note.

    You can just click the HTML button in the note itself and copy the contents.
  • hi again,

    it took me a while, but now I found a neat work-around:

    I modified http://www.htmlescape.net/htmlunescape_tool.html and let a local copy run the javascript to do the conversion (locally, without server interaction).

    Did this on a version with the p & plaintext tags still in it, but it worked nonetheless.

    Further, created a report from one of the many citations with faulty notes and also there the result was faulty (for a report with a single citation); hence, it's not down to the size of the report...

    Still not quite sure what the trigger is, but am reasonably content to have found a 2-second solution...

    Dan, clicking on the html-button (tinyMCE) of the faulty note produces clean html; so I don't know if that would help. If I find a faulty note which I'd be happy to share, I will.
  • don't check for faulty HTML - it may well be that the HTML is just fine, but something in it triggers plaintext mode - so if you have a note that appears with HTML tag in the report, please paste the entire HTML content of that note here.
  • It's easy to write a note whose HTML tags show up in reports. Here's one:

    <p>This note has two paragraphs, and the HTML tags show up in the report.</p>
    <p>This is the second paragraph.</p>

    I do hope the developers find the time to address this issue.
  • I also have the problem that ALL my notes show with HTML-tagging in reports - but only since some days. I checked, I was running 3.0.9 (now upgraded to 3.0.10, problem still there), which according to version history is supposed to have closed that bug. I have the problem since around the time 3.0.9 was released.

    Also new notes, even added to newly created library items, have the problem as soon as I enter a new paragraph. This source code shows correctly:
    <p>Test</p>

    this source code shows with tags:
    <p>Test</p>
    <p>testnote</p>

    Thanks for looking into it!
  • edited November 21, 2012
    I confirm this (either with old or new - i.e. post 3.0.8 - notes).
    It's clearly a bug.
    [FWIW, reverting this commit seems to do the trick, for me: https://github.com/zotero/zotero/commit/21bf3000cbe64ad5345bb731b0e8396aa004b13f ]
  • Sorry about that. Should be fixed in the latest 3.0 Branch dev XPI.
  • Great. Thanks.
  • Thanks a lot for quick answers, but both solutions didn't work for me:

    1. I don't know if I reverted the change correctly (downloaded the older version and manually replaced the report.js in zotero.jar/content/zotero/xpcom/), but it didn't work.

    2. Then I installed the latest branch xpi (3.0.10.r11074) over the standard one, didn't help either, even after firefox and system reboot..

    did I miss anything?
  • edited November 21, 2012
    For what HTML isn't it working?
  • OK, I can still reproduce a problem (with "&nbsp;"), though not with your example above.
  • edited November 21, 2012
    oh yes, that seems to be the difference: notes with "& nbsp;" (at the end or in the middle of source) won't show correctly right now, if i remove them, they work.

    Though I am pretty sure (but not 100%!!)that even the example above didn't show right before update to branch version.

    Well, problem found, but what to do with it? I want to have empty paragraphs ("& nbsp;") sometimes in my notes..

    thanks again for your help!!
  • Well, problem found, but what to do with it? I want to have empty paragraphs ("& nbsp;") sometimes in my notes..
    Dan will fix it as soon as possible (I think).
  • OK, try the latest 3.0 branch XPI. You may need to clear your browser cache.
  • Works for me, now, with notes containing nbsp chars (to avoid any misunderstanding, I've tested with Zotero running directly from a Git checkout).
  • Thanks again, but the above link to the latest branch still gives me version 3.0.10.r11074 (tested it anyways, also with cleared cache, didn't work), and I don't know how to use Git.
  • edited November 22, 2012
    You're right: the above link still gives version 3.0.10r11074 which has the problem with nbsp. I think it has not been updated yet.
  • Great, it works. Thanks for the quick fix!!
  • I had a hard time following this discussion - does this mean that this bug should be fixed in the most recent version of zotero? I'm still having html report issues.

    Thanks!
Sign In or Register to comment.