/    Sign up×
Community /Pin to ProfileBookmark

Rich text Editor => valid content ?

Hi together

We are using a Rich text Editor like this one:
[url]http://home.att.net/~codeLibrary/HTML/html_edit.htm[/url]

so based on Javascript.
The users can set text bold, italic, …

However we need a button which checks that the content which is entered into the Textarea is strict valid HTML, has someone done this before ?

The background of my question is, that we are building a CMS, which allows users to also enter HTML Source Code into the Rich Text Editor, however later we want to generate also pdfs out of the Content. To do this we have a Javaclass which takes the HTML Page (which is generated out of the RTE Field) and ‘transforms’ it into a pdf. However it fails when the content which is entered is not valid html ?

So we need to check for valid HTML, when content is entered.

(some dtd check or xml check, I am not so familiar with this)

Thanx for your help
and Greetings
Hans

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@jbotOct 25.2004 — if the RTE you're using is based on IE's then it won't produce valid HTML - it uses font tags, for example!

you can only validate HTML files. so, your file will need to be completed and uploaded before it can validated.

you could always write your own JS-enabled validator, but that would be a big project, especially if you're not much of a DOM coder LOL.
Copy linkTweet thisAlerts:
@h_distlerauthorOct 25.2004 — No, no IE is used. It runs on any browser (well almost any).

And it produces HTML.

So I dont want to save a file first and then validate it I want to check before I save it.

Thanx

Hannes
Copy linkTweet thisAlerts:
@jbotOct 25.2004 — [i]Originally posted by h_distler [/i]

[B]No, no IE is used. It runs on any browser (well almost any).

And it produces HTML.[/B]
[/QUOTE]


yes, and it produces crap, dated and deprecated markup. it prolly won't validate because of that.

[i]Originally posted by h_distler [/i]

[B]I dont want to save a file first and then validate it I want to check before I save it.[/B][/QUOTE]


don't think you'll be able to do that. technically, IE's RTE doesn't produce HTML till it's been saved. all you've really got is some inline formatted plain text. :rolleyes:
×

Success!

Help @h_distler spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...