Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/js_of_ocaml/dom_html.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ let onIE = Js.to_bool (caml_js_on_ie ())

external html_escape : js_string t -> js_string t = "caml_js_html_escape"

external decode_html_entities : js_string t -> js_string t = "caml_js_html_entities"
external html_entities : js_string t -> js_string t opt = "caml_js_html_entities"

let decode_html_entities s =
Js.Opt.get (html_entities s) (fun () -> failwith ("Invalid entity " ^ Js.to_string s))

class type cssStyleDeclaration = object
method setProperty :
Expand Down
3 changes: 1 addition & 2 deletions runtime/jslib_js_of_ocaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function caml_js_html_escape (s) {
}

//Provides: caml_js_html_entities
//Requires: caml_failwith
function caml_js_html_entities(s) {
var entity = /^&#?[0-9a-zA-Z]+;$/
if(s.match(entity))
Expand All @@ -49,7 +48,7 @@ function caml_js_html_entities(s) {
return str;
}
else {
caml_failwith("Invalid entity " + s);
return null;
}
}

Expand Down
Loading