@@ -5,7 +5,7 @@ Elm.Native.Text.make = function(elm) {
55 if (elm.Native.Text.values) return elm.Native.Text.values;
66
77 var JS = Elm.JavaScript.make(elm);
8− var htmlHeight = Elm.Native.Utils.make(elm).htmlHeight;
8+ var Utils = Elm.Native.Utils.make(elm);
99 var Color = Elm.Native.Color.make(elm);
1010 var Element = Elm.Graphics.Element.make(elm);
1111 var show = Elm.Native.Show.make(elm).show;
@@ -51,15 +51,16 @@ Elm.Native.Text.make = function(elm) {
5151 return arr.join('<br/>');
5252 }
5353
54− function toText(str) { return properEscape(JS.fromString(str)); }
54+ function toText(str) { return Utils.txt(properEscape(JS.fromString(str))); }
5555
56− function addTag(tag) { return function(text) {
57− return '<' + tag + ' style="padding:0;margin:0">' + text + '</' + tag + '>';
56+ function addTag(tag) {
57+ return function(text) {
58+ return Utils.txt('<' + tag + '>' + text + '</' + tag + '>');
59+ }
5860 }
59− }
6061
6162 function addStyle(style, value, text) {
62− return "<span style='" + style + ":" + value + "'>" + text + "</span>";
63+ return Utils.txt("<span style='" + style + ":" + value + "'>" + text + "</span>");
6364 }
6465
6566 function typeface(name, text) {
@@ -75,8 +76,8 @@ Elm.Native.Text.make = function(elm) {
7576 var bold = addTag('b');
7677
7778 function extract(c) {
78− if (c._3 === 1) { return 'rgb(' + c._0 + ',' + c._1 + ',' + c._2 + ')'; }
79− return 'rgba(' + c._0 + ',' + c._1 + ',' + c._2 + ',' + c._3 + ')';
79+ if (c._3 === 1) { return 'rgb(' + c._0 + ', ' + c._1 + ', ' + c._2 + ')'; }
80+ return 'rgba(' + c._0 + ', ' + c._1 + ', ' + c._2 + ', ' + c._3 + ')';
8081 }
8182 function color(c, text) {
8283 return addStyle('color', extract(c), text);
@@ -87,7 +88,7 @@ Elm.Native.Text.make = function(elm) {
8788 return addStyle('text-decoration', 'line-through', text);
8889 }
8990 function link(href, text) {
90− return "<a href='" + toText(href) + "'>" + text + "</a>";
91+ return Utils.txt("<a href='" + toText(href) + "'>" + text + "</a>");
9192 }
9293
9394 function position(pos) {
@@ -96,7 +97,7 @@ Elm.Native.Text.make = function(elm) {
9697 _0: '<div style="padding:0;margin:0;text-align:' +
9798 pos + '">' + text + '</div>'
9899 };
99− var p = A2(htmlHeight, 0, text);
100+ var p = A2(Utils.htmlHeight, 0, text);
100101 return A3(Element.newElement, p._0, p._1, e);
101102 }
102103 }
@@ -132,5 +133,4 @@ Elm.Native.Text.make = function(elm) {
132133
133134 asText : asText
134135 };
135−
136136};