Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function for converting HTML4.html to string #241

Closed
JohnReppy opened this issue Jul 16, 2022 · 0 comments
Closed

Add function for converting HTML4.html to string #241

JohnReppy opened this issue Jul 16, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request fixed-in-2022.1 issue is fixed in the 2022.1 release gforge bug (or feature request) ported from smlnj-gforge repository

Comments

@JohnReppy
Copy link
Contributor

Description of the problem

It seems that there is no function in the HTML4 library that has the signature
HTML4.html -> string. Could such a function be added to the HTML4 library?
If not, is there any way to convert a HTML4.html value into a string?

Comments from smlnj-gforge

Original smlnj-gforge bug number 308

Submitted on 2022-38-14 at 00:3800

comment by @JohnReppy on 2022-36-30 13:3600 +000 UTC

It is straightforward to generate a string from the existing API. Using a CharBuffer, the following code does so: ~ ~ fun toString html = let ~ val buf = CharBuffer.new 1024 ~ in ~ HTML4Print.prHTML { ~ putc = fn c => CharBuffer.add1 (buf, c), ~ puts = fn s => CharBuffer.addVec (buf, s) ~ } html; ~ CharBuffer.contents buf ~ end; ~ ~ I've added this code to the header comment for the HTML4Print module and will include it in the documentation (when we get to it).

comment by @JohnReppy on 2022-50-11 18:5000 +000 UTC

Moved to feature requests

comment by @JohnReppy on 2022-50-11 18:5000 +000 UTC

Moved from Bugs to Feature Requests

@JohnReppy JohnReppy added enhancement New feature or request gforge bug (or feature request) ported from smlnj-gforge repository labels Jul 16, 2022
@JohnReppy JohnReppy self-assigned this Jul 16, 2022
@JohnReppy JohnReppy added the fixed-in-2022.1 issue is fixed in the 2022.1 release label Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed-in-2022.1 issue is fixed in the 2022.1 release gforge bug (or feature request) ported from smlnj-gforge repository
Projects
None yet
Development

No branches or pull requests

1 participant