Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2008-12-19 09:34:36

garvinhicking
New member
Registered: 2008-12-19
Posts: 5

How to disable Xinha formatting/indenting HTML?

Hi!

I'm a developer of the Serendipity weblog application, and for our upcoming release we are using Xinha as our WYSIWYG editor of preference. Formerly we used HTMLArea and hat a lot of browser issues that can be circumvented with your great work on Xinha. Thank you for the amount of work you have put into it so far, the community really appreciates this.

We have faced a small problem though. We used functions to store additional HTML inside the textarea with the WYSIWYG module, stuff like

<div class="blabla"><img src="..." /><span.../></div>

We needed to put this on a single line and pass it onto the textarea, because later on our blog system can apply markup plugisn to the output (like nl2br). HTMLArea forwarded this pasted HTML as a single line properly.

Xinha now inserted spaced indenting and linebreaks and formats the code to:

<div class="blabla">
  <img src="..." />
  <span.../>
</div>

Which is rendered by out markup plugin as:

<div class="blabla"><br />
  <img src="..." /><br />
  <span.../><br />
</div><br />

This of course renders a completely different view.

Much mumble about an easy question: How can we instruct Xinha to NOT touch any HTML we pass to it in terms of indenting? We really need the HTML raw code to be on one continuous line.

Many thanks and best regards,
Garvin

Offline

#2 2008-12-19 16:30:03

nicholasbs
Moderator
Registered: 2008-08-12
Posts: 16

Re: How to disable Xinha formatting/indenting HTML?

Hi Garvin,

As far as I know, this is not currently a configurable option. I've created a ticket proposing this be made configurable here.

If you're using TransformInnerHTML (i.e., xinha_config.getHtmlMethod is to to 'TransformInnerHTML'), a quick-and-dirty hack would be to simply comment out the following line (line 215 in trunk) in modules/GetHtml/TransformInnerHTML.js:

html = Xinha.indent(html);

Of course, it'd be much nicer/cleaner to have this as a proper configuration option (and this won't work if you're using the default getHtml method DOMwalk instead of TransformInnerHTML). Hopefully this will change in the future.

Hope this helps,
   -Nick

Offline

#3 2008-12-19 16:54:00

garvinhicking
New member
Registered: 2008-12-19
Posts: 5

Re: How to disable Xinha formatting/indenting HTML?

Hi!

Thanks for getting back to me so quickly. I've read your ticket proposal. I actually simply removed the \n for now, which does the trick for the isolated incident. I'll keep an eye on the tracker if someone reports problems whether on some places Xinha expects newlines. But I simply hope that's not the case, since Xinha already needs to deal with single-line HTML that people might write into the editor earlier on ;-)

As for inserting, we currently use the surroundHTML function (a  htmlarea-relic), and it seems this required a patch in the DOMwalk.js file for the linewrapping...

Best regards,
Garvin

Offline

#4 2008-12-19 17:44:00

nicholasbs
Moderator
Registered: 2008-08-12
Posts: 16

Re: How to disable Xinha formatting/indenting HTML?

Great to hear you've got it working!

Out of curiosity, what version of Xinha are you running?

Cheers,
  -Nick

Offline

#5 2008-12-19 17:53:37

garvinhicking
New member
Registered: 2008-12-19
Posts: 5

Re: How to disable Xinha formatting/indenting HTML?

Hi!

Phew, I used the latest one available about 4 or 5 weeks ago - 0.95 was stable at that time. Do you suggest a different version, and if so, are there any issues to be aware of?

Best regards,
Garvin

Offline

#6 2008-12-19 18:46:00

nicholasbs
Moderator
Registered: 2008-08-12
Posts: 16

Re: How to disable Xinha formatting/indenting HTML?

Garvin,

0.95 is still the latest stable version, but the next version, 0.96, should be coming before too long. We're hoping to have a beta release of 0.96 shortly (within a couple weeks), with a final release following some time after that (depending of course on how many issues are found with the beta). The new release contains lots of bug fixes and user interface improvements, including a switch to lightbox-style dialogs.

Cheers,
  -Nick

Offline

#7 2010-11-20 12:13:57

phelps
New member
Registered: 2010-11-06
Posts: 2

Re: How to disable Xinha formatting/indenting HTML?

Actually I'm totally eagerly waiting for upcoming the version 0.96. I wish it'll do good task better than 0.95..

Have you want to experience with new something you can travel on here... bartending online course

Last edited by phelps (2011-09-10 03:33:00)

Offline

#8 2010-11-20 14:42:42

ejucovy
Xinha Community Member
From: NY
Registered: 2010-11-15
Posts: 35
Website

Re: How to disable Xinha formatting/indenting HTML?

phelps, version 0.96.1 was tagged and released in May: http://trac.xinha.org/wiki/DownloadsPage

Though, it's still listed as "beta" and the last "stable" is 0.95 - is that intentional, or can we mark that 0.96.1 release as stable?

Offline

#9 2010-11-20 19:04:24

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: How to disable Xinha formatting/indenting HTML?

Yes if you like, we really have no "stable" or "beta", indeed releases are really just "when somebody feels like it", most everybody should (and to my knowledge does) take Xinha straight from trunk :-)


James Sleeman

Offline

#10 2010-11-20 19:09:52

ejucovy
Xinha Community Member
From: NY
Registered: 2010-11-15
Posts: 35
Website

Re: How to disable Xinha formatting/indenting HTML?

Heh, okay, I'll go ahead and change the wiki page.  0.96.1 is now officially stable. ;-)

Offline

#11 2010-12-16 13:01:58

jasonbill
New member
Registered: 2010-10-13
Posts: 1

Re: How to disable Xinha formatting/indenting HTML?

It is good to see that version 0.96 will release on May. But it'd be better if 0.96 will be stabled than 0.95.

Thanks......




Palm Springs DUI Lawyer
Palm Springs DUI

Last edited by jasonbill (2010-12-19 10:05:12)

Offline

#12 2012-10-26 11:44:14

GeraldPeterson
New member
Registered: 2012-10-26
Posts: 1

Re: How to disable Xinha formatting/indenting HTML?

Version .96 is more stable than the older version. I use this and recommend others to use it. It will solve problems formatting the urls also.

Catering London

Offline

Board footer

Powered by FluxBB