mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
Merge branch 'master' into editor
This commit is contained in:
@@ -66,6 +66,9 @@ class Builder
|
||||
text: (string) ->
|
||||
@document.push(new Text(string))
|
||||
|
||||
raw: (string) ->
|
||||
@document.push(new Text(string, true))
|
||||
|
||||
wireOutlets: (view) ->
|
||||
view.find('[outlet]').each ->
|
||||
elt = $(this)
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
module.exports =
|
||||
class Text
|
||||
constructor: (@string) ->
|
||||
constructor: (@string, @raw=false) ->
|
||||
|
||||
toHtml: ->
|
||||
@string
|
||||
.replace(/&/g, '&')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
if @raw
|
||||
@string
|
||||
else
|
||||
@string
|
||||
.replace(/&/g, '&')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user