let marked = Netencoding.Html.encode ~in_enc:`Enc_utf8 ~prefer_name:false
() (html_of_matita marked) in
raise (Emphasized_error marked)
+ | NTacStatus.Error (s,None) as e ->
+ prerr_endline
+ ("NTacStatus.Error " ^ (Lazy.force s));
+ raise e
+ | NTacStatus.Error (s,Some exc) as e ->
+ prerr_endline
+ ("NTacStatus.Error " ^ Lazy.force s ^ " -- " ^ (Printexc.to_string exc));
+ raise e
| GrafiteDisambiguate.Ambiguous_input (loc,choices) ->
let x,y = HExtlib.loc_of_floc loc in
let choice_of_alias = function
matita.ambiguityStart = start;
matita.ambiguityStop = stop;
- matita.unlockedbackup = unlocked.innerHTML;
+ matita.unlockedbackup = unlocked.innerHTML.html_to_matita();
matita.interpretations = [];
- var unlockedtxt = unlocked.innerHTML;
- var pre = unlockedtxt.substring(0,start);
- var mid = unlockedtxt.substring(start,stop);
- var post = unlockedtxt.substring(stop);
+ var unlockedtxt = unlocked.innerHTML.html_to_matita();
+ var pre = unlockedtxt.substring(0,start).matita_to_html();
+ var mid = unlockedtxt.substring(start,stop).matita_to_html();
+ var post = unlockedtxt.substring(stop).matita_to_html();
unlocked.innerHTML = pre +
"<span class=\"error\" title=\"disambiguation error\">" +
mid + "</span>" + post;
var cancelbutton = document.createElement("input");
cancelbutton.setAttribute("type","button");
cancelbutton.setAttribute("value","Cancel");
- cancelbutton.setAttribute("onclick","void(0)");
+ cancelbutton.setAttribute("onclick","cancel_disambiguate()");
disambcell.appendChild(okbutton);
disambcell.appendChild(cancelbutton);
return null;
}
+function cancel_disambiguate() {
+ matita.disambMode = false;
+ updateSide();
+}
+
function do_disambiguate() {
var i = get_checked_index("interpr");
if (i != null) {
- var pre = matita.unlockedbackup.substring(0,matita.ambiguityStart);
- var mid = matita.unlockedbackup.substring(matita.ambiguityStart,matita.ambiguityStop);
- var post = matita.unlockedbackup.substring(matita.ambiguityStop);
+ var pre = matita.unlockedbackup
+ .substring(0,matita.ambiguityStart).matita_to_html();
+ var mid = matita.unlockedbackup
+ .substring(matita.ambiguityStart,matita.ambiguityStop)
+ .matita_to_html();
+ var post = matita.unlockedbackup
+ .substring(matita.ambiguityStop).matita_to_html();
var href = matita.interpretations[i].href;
var title = matita.interpretations[i].title;