Replies: 1 comment 4 replies
-
If you pass HTML source code like |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Chapter 1's Exercise:
view-source: In addition to HTTP and HTTPS, there are other schemes, such as view-source; navigating in a real browser to view-source:http://browser.engineering/http.html shows the HTML source of this chapter rather than its rendered output. Add support for the view-source scheme. Your browser should print the entire HTML file as if it was text. Hint: To do so, you can utilize the entities from the previous exercise, and add an extra transform() method that adjusts the input to show() when in view-source mode, like this: show(transform(body))
the Hint is a bit confusing. Is there an expected difference of output here compared to just printing a plain text response of the raw HTML content? Not sure where encodings /
transform
would be useful given an input of raw HTML, unless the exercise is implying HTML validation as well prior to outputting theview-source
content (in which case, that would make sense but it's unclear at this step). Inspecting theview-source
output in my browser (Chrome on Mac OSX) does show a<table>
rendering of the source HTML, but I believe this is a browser default (not a good use of<table>
in my opinion...), and plain text output seems sufficient.Beta Was this translation helpful? Give feedback.
All reactions