Open samdutton opened 5 years ago
I can look into it :-)
Can you give me some example code to make it clear what you want to validate?
My 2 cents:
isLocal
to true, and use the localhost url to verify.My idea is to wrap the fragments in <html><body></body></html>
and use the validator as usual.
You would probably need to activate this sort of behaviour with a special flag.
This would work if fragments = parts of html.
I think the base template has to be a bit more complicated than that. I tested just now with w3c validator. and I think this is the bare minimum you need.
<!doctype html><html lang=""><head><title>fragment</title></head><body>
<!-- insert fragment -->
</body></html>
Yeah, that's the minimum for a valid document. I don't think it would require much effort to add this functionality either. I'll look at it tomorrow.
Can you give me some example code to make it clear what you want to validate?
I've written a Node app to convert SRT captions https://en.wikipedia.org/wiki/SubRip to 'readable' HTML.
I would like to be able to offer the output as a complete document, or as a 'fragment', i.e. just the content.
On Sat, 13 Jul 2019 at 22:24, Geir Gåsodden notifications@github.com wrote:
Yeah, that's the minimum for a valid document. I don't think it would require much effort to add this functionality either. I'll look at it tomorrow.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zrrrzzt/html-validator/issues/150?email_source=notifications&email_token=AABSDKTTXVUQ5UW5N34QPXDP7JBYJA5CNFSM4ICGRBR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ3ZUOY#issuecomment-511154747, or mute the thread https://github.com/notifications/unsubscribe-auth/AABSDKTEMWHOVPQ26LRZTODP7JBYJANCNFSM4ICGRBRQ .
Just released version 4.1.0
Now you can add fragments as data
and set isFragment
to true.
Hope this works out for you use case @samdutton
Wow — that was quick! Thank you.
On Sun, 14 Jul 2019 at 10:58, Geir Gåsodden notifications@github.com wrote:
Just released version 4.1.0
Now you can add fragments as data and set isFragment to true.
Hope this works out for you use case @samdutton https://github.com/samdutton
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zrrrzzt/html-validator/issues/150?email_source=notifications&email_token=AABSDKUIZLMKDDW4OXFZMCDP7L2ETA5CNFSM4ICGRBR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ4CB3I#issuecomment-511189229, or mute the thread https://github.com/notifications/unsubscribe-auth/AABSDKSL26WI6EXN6C6G2NDP7L2ETANCNFSM4ICGRBRQ .
Not sure if this is possible, but I'd love to be able to use this to validate HTML fragments as well as complete documents.
Great module, by the way — thanks!