Book a Demo

Author Topic: Avoid HTML escaping in HTML report  (Read 6348 times)

Rüdiger Engelberger

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Avoid HTML escaping in HTML report
« on: April 02, 2013, 09:26:43 pm »
Hi,

When I publish my project as HTML I notes of an element always get HTML escaped.

e.g.:

I enter "Auszug ELKA-Benutzerdoku:" then 2 line breaks and then a link to the notes rich text field of a mind map topic. And I underline the first sentence.

Then I always get the following in the HTML report:

<u>Auszug ELKA-Benutzerdoku:</u><br /></p><p><br /></p><p><a href="http://svn.r-services.at/repos/

So all formatting done by the EA rich text editor is HTML escaped.

When I look into the resources the web style template of "Content - Notes" looks like:

<div class="ObjectDetailsNotes">#VALUE#</div>

=> #VALUE# is the content of the note.

So I don't see how I can influence that behaviour. It doesn't make sense at all.

Thanks!

Rüdiger Engelberger

Patrick Julian

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Avoid HTML escaping in HTML report
« Reply #1 on: April 03, 2013, 12:37:31 am »
Have you tried to apply an ID to the
Code: [Select]
<div class="ObjectDetailsNotes"> and execute some JavaScript on it?

Rüdiger Engelberger

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Avoid HTML escaping in HTML report
« Reply #2 on: April 03, 2013, 01:02:13 am »
Sorry, maybe I didn't get your answer.

Do you mean that I should add an id into the div tag like:

<div class="ObjectDetailsNotes" id="someId">

And which kind of Javascript code do you mean?

Maybe I wasn't able to present my problem:

The problem is that anything written in an element's notes is HTML escaped in the HTML report (Publish as HTML). The div tag is just for formatting the HTML output.

Thx
Rüdiger

Patrick Julian

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Avoid HTML escaping in HTML report
« Reply #3 on: April 04, 2013, 12:27:44 am »
Quote
Do you mean that I should add an id into the div tag like:

<div class="ObjectDetailsNotes" id="someId">

Yes

Quote
And which kind of Javascript code do you mean?

Well, you'd have to write the code yourself that parses the contents of said <div> element and undoes the escaping of the tokens. So the ID in the HTML would be to reference the <div> and allow JavaScript to modify it's contents once they have been injected by whatever magic the report generator applies on it. I hope now it is more understandable what I mean.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Avoid HTML escaping in HTML report
« Reply #4 on: April 04, 2013, 06:01:25 pm »
There must be a better solution to this then hacking into the html code.
Have you tried reporting the issue to Sparx support using the Report a buglinks on the bottom of the page?

Geert

Rüdiger Engelberger

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Avoid HTML escaping in HTML report
« Reply #5 on: April 04, 2013, 07:09:25 pm »
Hi,

Many thanks for your hint.

This would be a workaround for the problem.

But in my opinion this HTML escaping shouldn't be done by EA when publishing as HTML.

The formatting is done by EA itself. It's just nonsense to escape that.

Does anybody know if it's possible to prevent that.

Thx!

Rüdiger

Patrick Julian

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Avoid HTML escaping in HTML report
« Reply #6 on: April 04, 2013, 09:39:43 pm »
Hi guys,

I know that what I proposed is a workaround that should not be necessary. So I totally agree that it is an issue that you should report to Sparx.

Rüdiger Engelberger

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Avoid HTML escaping in HTML report
« Reply #7 on: April 04, 2013, 10:11:26 pm »
I just reported a bug to Sparx Systems.

I'll keep you informed ... hopefully they have a solution.

Thx!

Rüdiger Engelberger

Rüdiger Engelberger

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Avoid HTML escaping in HTML report
« Reply #8 on: April 05, 2013, 05:37:01 pm »
Hi,

Just got an answer from Sparx Systems support ... it's a bug and it will be fixed in one of the future releases. In the meantime you can use the simple workaround described in the following mail:

Hi Rüdiger,

Thank you for your note.
 
This issue has been reported previously by another user also and is logged as a bug to be fixed.  We cannot yet say when (in which build) the fix will be implemented.

Reference Number: 13045026

In our tests the error occurs only in FireFox.  If you are using a different browser and still seeing this error please let us know.

As a current workaround you should be able to avoid the issues in FireFox by doing the following...

1. Open Resources window. 'Project | Resources'
2. Select in the Resource tree. 'Resources | Templates | Web Style Templates'
3. Right click to open context menu and select 'Create HTML Template'. (Name your template in popup dialog) ok 4. In 'HTML and CSS Style Editor' that opens, select 'Javascript' from the Templates list.
5. Find' function initPage(src)'
6. Comment out condition '//if (toc.document == null)' on line 260 7. Comment out condition '//if (cont.document == null)' on line 263 8. Save changes and close editor 9. Now when you generate your HTML report, select your new template in the 'Style' field of the 'Publish as HTML' dialog.
10. Navigate HTML report with FireFox

If you have further questions or issues please let us know.

Best Regards,

Simon Cotching
Sparx Systems Pty Ltd
[email protected]
http://www.sparxsystems.com


Rüdiger Engelberger

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Avoid HTML escaping in HTML report
« Reply #9 on: April 05, 2013, 05:55:00 pm »
You see, its usually worth the trouble to report something to Sparx.
Thanks for posting the solution.

Geert