diff --git a/extras/imported/html-mode/.yas-setup.el b/extras/imported/html-mode/.yas-setup.el
index 69d49c9..37ca4ba 100644
--- a/extras/imported/html-mode/.yas-setup.el
+++ b/extras/imported/html-mode/.yas-setup.el
@@ -17,7 +17,7 @@
(setq word-begin (point))
(forward-word 1)
(setq word-end (point)))
- (when (and (> word-end word-begin)
+ (when (and (< word-begin orig-point)
(>= word-end (point)))
(setq retval
(cons
@@ -57,12 +57,19 @@
(defun yas/html-wrap-each-line-in-openclose-tag ()
(let* ((mirror "${1:$(yas/html-first-word yas/text)}")
+ (yas/html-wrap-newline (when (string-match "\n" yas/selected-text) "\n"))
(template (concat (format "<${1:%s}>" (or yas/html-default-tag "p"))
yas/selected-text
"" mirror ">")))
- (setq template (replace-regexp-in-string "\n" (concat "" mirror ">\n<" mirror ">") template))
+ (setq template (replace-regexp-in-string "\n" (concat "" mirror ">\n<$1>") template))
(yas/expand-snippet template)))
+(defun yas/html-wrap-selection-if-not-wrapped-already (wrapping)
+ (if (string-match (format "<%s>.*%s>" wrapping wrapping) yas/selected-text)
+ (insert yas/selected-text)
+ (insert (format "<%s>%s%s>" wrapping yas/selected-text wrapping))))
+
+
(defun yas/html-between-tag-pair-p ()
(save-excursion
(backward-word)
diff --git a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_0 only.yasnippet b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_0 only.yasnippet
index 8bd737b..5536009 100644
--- a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_0 only.yasnippet
+++ b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_0 only.yasnippet
@@ -4,4 +4,4 @@
# name: IE Conditional Comment: Internet Explorer 5.0 only
## condition: "text.html"
# --
-$0
\ No newline at end of file
+$0
\ No newline at end of file
diff --git a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_5 only.yasnippet b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_5 only.yasnippet
index a5afa6e..d740f16 100644
--- a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_5 only.yasnippet
+++ b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_5 only.yasnippet
@@ -4,4 +4,4 @@
# name: IE Conditional Comment: Internet Explorer 5.5 only
## condition: "text.html"
# --
-$0
\ No newline at end of file
+$0
\ No newline at end of file
diff --git a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_x.yasnippet b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_x.yasnippet
index 17e31d6..272c442 100644
--- a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_x.yasnippet
+++ b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 5_x.yasnippet
@@ -4,4 +4,4 @@
# name: IE Conditional Comment: Internet Explorer 5.x
## condition: "text.html"
# --
-$0
\ No newline at end of file
+$0
\ No newline at end of file
diff --git a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 6 and below.yasnippet b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 6 and below.yasnippet
index 23dd74e..594d847 100644
--- a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 6 and below.yasnippet
+++ b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 6 and below.yasnippet
@@ -4,4 +4,4 @@
# name: IE Conditional Comment: Internet Explorer 6 and below
## condition: "text.html"
# --
-$0
\ No newline at end of file
+$0
\ No newline at end of file
diff --git a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 6 only.yasnippet b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 6 only.yasnippet
index b35dff4..c28d7b7 100644
--- a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 6 only.yasnippet
+++ b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 6 only.yasnippet
@@ -4,4 +4,4 @@
# name: IE Conditional Comment: Internet Explorer 6 only
## condition: "text.html"
# --
-$0
\ No newline at end of file
+$0
\ No newline at end of file
diff --git a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 7+.yasnippet b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 7+.yasnippet
index 2e82875..c762c27 100644
--- a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 7+.yasnippet
+++ b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer 7+.yasnippet
@@ -4,4 +4,4 @@
# name: IE Conditional Comment: Internet Explorer 7 and above
## condition: "text.html"
# --
-$0
\ No newline at end of file
+$0
\ No newline at end of file
diff --git a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer.yasnippet b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer.yasnippet
index dcb89cd..00ef361 100644
--- a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer.yasnippet
+++ b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment Internet Explorer.yasnippet
@@ -4,4 +4,4 @@
# name: IE Conditional Comment: Internet Explorer
## condition: "text.html"
# --
-$0
\ No newline at end of file
+$0
\ No newline at end of file
diff --git a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment NOT Internet Explorer.yasnippet b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment NOT Internet Explorer.yasnippet
index fc12208..01de4a0 100644
--- a/extras/imported/html-mode/Conditional Comments/IE Conditional Comment NOT Internet Explorer.yasnippet
+++ b/extras/imported/html-mode/Conditional Comments/IE Conditional Comment NOT Internet Explorer.yasnippet
@@ -4,4 +4,4 @@
# name: IE Conditional Comment: NOT Internet Explorer
## condition: "text.html"
# --
-${1:${TM_SELECTED_TEXT: IE Conditional Comment: NOT Internet Explorer }}$0
\ No newline at end of file
+${1:`(or yas/selected-text " IE Conditional Comment: NOT Internet Explorer ")`}$0
\ No newline at end of file
diff --git a/extras/imported/html-mode/Entities/XHTML   NonBreakingSpace.yasnippet b/extras/imported/html-mode/Entities/XHTML   NonBreakingSpace.yasnippet
index d331dff..0f971dd 100644
--- a/extras/imported/html-mode/Entities/XHTML   NonBreakingSpace.yasnippet
+++ b/extras/imported/html-mode/Entities/XHTML   NonBreakingSpace.yasnippet
@@ -1,7 +1,8 @@
# -*- mode: snippet -*-
# contributor: Translated from TextMate Snippet
# name: Non-Breaking Space
-## binding: "~ "
+# key: nbsp
+## binding: " "
## condition: "text.html"
# --
\ No newline at end of file
diff --git a/extras/imported/html-mode/Format/Emphasize.yasnippet b/extras/imported/html-mode/Format/Emphasize.yasnippet
index a32a4b7..f52d864 100644
--- a/extras/imported/html-mode/Format/Emphasize.yasnippet
+++ b/extras/imported/html-mode/Format/Emphasize.yasnippet
@@ -1,7 +1,7 @@
# -*- mode: snippet -*-
-# contributor: Translated from TextMate Snippet
+# type: command
# name: Emphasize
-# binding: "A-i"
+# binding: A-i
## condition: "text.html"
# --
(yas/html-wrap-selection-if-not-wrapped-already "em")
diff --git a/extras/imported/html-mode/Format/Strong.yasnippet b/extras/imported/html-mode/Format/Strong.yasnippet
index 1811554..0fa9fdc 100644
--- a/extras/imported/html-mode/Format/Strong.yasnippet
+++ b/extras/imported/html-mode/Format/Strong.yasnippet
@@ -1,8 +1,7 @@
# -*- mode: snippet -*-
# type: command
-# contributor: Translated from TextMate Snippet
# name: Strong
-# binding: "A-b"
+# binding: A-b
## condition: "text.html"
# --
(yas/html-wrap-selection-if-not-wrapped-already "strong")
diff --git a/extras/imported/html-mode/Insert Tag/Embed QT movie (movie).yasnippet b/extras/imported/html-mode/Insert Tag/Embed QT movie (movie).yasnippet
index b717869..e906c01 100644
--- a/extras/imported/html-mode/Insert Tag/Embed QT movie (movie).yasnippet
+++ b/extras/imported/html-mode/Insert Tag/Embed QT movie (movie).yasnippet
@@ -5,13 +5,13 @@
## condition: "text.html"
# --
\ No newline at end of file
diff --git a/extras/imported/html-mode/Insert Tag/Fieldset.yasnippet b/extras/imported/html-mode/Insert Tag/Fieldset.yasnippet
index fb35442..eaedcb9 100644
--- a/extras/imported/html-mode/Insert Tag/Fieldset.yasnippet
+++ b/extras/imported/html-mode/Insert Tag/Fieldset.yasnippet
@@ -4,7 +4,7 @@
# name: Fieldset
## condition: "text.html"
# --
-