[Pkg-javascript-commits] [ltx] 01/25: tagString (#99)
Jonas Smedegaard
dr at jones.dk
Tue Jan 10 18:21:45 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository ltx.
commit 9dbdad5ffa59c6c90ef574e5c8b8763e1cc89eea
Author: Sonny Piers <sonny at fastmail.net>
Date: Thu Sep 29 00:38:34 2016 +0200
tagString (#99)
---
index.js | 2 ++
lib/tag.js | 14 ++------------
lib/{tag.js => tagString.js} | 5 ++---
3 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/index.js b/index.js
index 9ea11f0..0552ca2 100644
--- a/index.js
+++ b/index.js
@@ -7,6 +7,7 @@ var Element = require('./lib/Element')
var equal = require('./lib/equal')
var createElement = require('./lib/createElement')
var tag = require('./lib/tag')
+var tagString = require('./lib/tagString')
var is = require('./lib/is')
exports = module.exports = tag
@@ -33,3 +34,4 @@ exports.Parser = Parser
exports.parse = parse
exports.tag = tag
+exports.tagString = tagString
diff --git a/lib/tag.js b/lib/tag.js
index e806dff..727c909 100644
--- a/lib/tag.js
+++ b/lib/tag.js
@@ -1,18 +1,8 @@
'use strict'
-var escape = require('./escape').escapeXML
+var tagString = require('./tagString')
var parse = require('./parse')
module.exports = function tag (/* [literals], ...substitutions */) {
- var literals = arguments[0]
-
- var str = ''
-
- for (var i = 1; i < arguments.length; i++) {
- str += literals[i - 1]
- str += escape(arguments[i])
- }
- str += literals[literals.length - 1]
-
- return parse(str)
+ return parse(tagString.apply(null, arguments))
}
diff --git a/lib/tag.js b/lib/tagString.js
similarity index 68%
copy from lib/tag.js
copy to lib/tagString.js
index e806dff..a188c37 100644
--- a/lib/tag.js
+++ b/lib/tagString.js
@@ -1,9 +1,8 @@
'use strict'
var escape = require('./escape').escapeXML
-var parse = require('./parse')
-module.exports = function tag (/* [literals], ...substitutions */) {
+module.exports = function tagString (/* [literals], ...substitutions */) {
var literals = arguments[0]
var str = ''
@@ -14,5 +13,5 @@ module.exports = function tag (/* [literals], ...substitutions */) {
}
str += literals[literals.length - 1]
- return parse(str)
+ return str
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git
More information about the Pkg-javascript-commits
mailing list