w3m icon indicating copy to clipboard operation
w3m copied to clipboard

script tag cause bad page rendering

Open mozbugbox opened this issue 5 years ago • 2 comments

w3m doesn't render html files with self closed <script> tag like:

<script src="asource.js" />

If the script tag closed with "", then the rendering works properly:

<script src="asource.js"></script>

A sample file uploaded: test.txt

mozbugbox avatar Oct 06 '20 02:10 mozbugbox

This is invalid HTML, the script tag needs a . It may work in other browsers as they "fix" the HTML, but this is invalid syntax

DannyJJK avatar Nov 01 '20 20:11 DannyJJK

This is invalid HTML, the script tag needs a . It may work in other browsers as they "fix" the HTML, but this is invalid syntax

Indeed, it doesn't work in Firefox either. It is however valid xhtml, which w3m parses with the same parser as html, so perhaps OP ran into an xhtml page. I've looked into basic xhtml support before (so such a tag would be accepted in xhtml documents) but I couldn't figure out how to; perhaps I'll try again in the future.

bptato avatar Nov 06 '20 18:11 bptato