/John
Bill Conlon wrote:
I like the idea of a filter to convert HTML to XHTML, such as the perl modules that come with swish-e, but I'm not sure they will be general enough for correcting user input. Even the Tidy and w3.org tools can only tell you there is a missing </p>, not where it should go.
Agreed.
Remember, you could use that custom tag as a way of massaging the code going into the database, not just at display time.
Or perhaps for a more robust solution, you could find an HTML 2 XHTML command line program that you could use to reformat any html that your users enter,build a custom tag to call it, and then put the code in the database. That way, you get more than just simple search and replace functionality for <br> tags.
/John
Bill Conlon wrote:
John,
Thanks for the suggestion. I haven't built a custom tag yet, so this could be an opportunity. But it would be far more convenient to continue using the Encoding Attribute, which applies to all metatags.
I'm hoping there is a simple patch that can be made, but recognize that it probably requires re-compilation. In the long run, I think we need a configuration variable that selects the language (various HTML flavors, XHTML, XML) and then selects the appropriate encoding from a table.
In my case, all the offending tags are a result of user input, either in threaded comment systems for reviewing comments and posting feature requests/bug reports, or in an administrative system. So the right answer for me is probably to convert NewLine/Carriage Returns into <br /> on input to the database. This should result in faster performance as well, since the app server wpn't have to examine and modify long strings.
Phil,Bill Conlon
Sounds like we need a new encoding type, but in the meantime....
Bill,
You could make your own custom metatag to do the search and replace of <br> with <br/> in the meantime.
Usage would be. <@HTML2XHTML CODE=<@Var Local$TheVarToOutput> encoding=None>
HTML2XHTML Method code.
return the following...
<@replace str=<@var Method$Code encoding=MultilineHTML> findstr="<br>" replacestr="<br />">
That's about all you would need... plust the entry in your customtags.xml file
This code is not tested in any way, and you should consult the docs to make sure the attribute names and values i used in the example are appropriate.
/John
Bill Conlon wrote:
I need to produce valid XHTML 1.0 Transitional -- meaning I need my HTML tags to close.
How do I get the app server to insert <br /> instead of <br>?
Bill Conlon
To the Point 345 California Avenue Suite 2 Palo Alto, CA 94306
office: 650.327.2175 fax: 650.329.8335 mobile: 650.906.9929 e-mail: mailto:[EMAIL PROTECTED] web: http://www.tothept.com
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
To the Point 345 California Avenue Suite 2 Palo Alto, CA 94306
office: 650.327.2175 fax: 650.329.8335 mobile: 650.906.9929 e-mail: mailto:[EMAIL PROTECTED] web: http://www.tothept.com
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
Bill Conlon
To the Point 345 California Avenue Suite 2 Palo Alto, CA 94306
office: 650.327.2175 fax: 650.329.8335 mobile: 650.906.9929 e-mail: mailto:[EMAIL PROTECTED] web: http://www.tothept.com
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
