brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: jsgui: Replace _.template with cu...
Date Fri, 26 Sep 2014 19:22:51 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/192#discussion_r18108388
  
    --- Diff: usage/jsgui/src/main/webapp/assets/js/util/brooklyn.js ---
    @@ -60,6 +60,23 @@ define([
             }
         })();
     
    +    var template = _.template;
    +    _.mixin({
    +        /**
    +         * @param {string} text
    +         * @return string The text with HTML comments removed.
    +         */
    +        stripComments: function (text) {
    +            return text.replace(/<!--(.|[\n\r\t])*?-->[\n\r]?/g, "");
    --- End diff --
    
    Doesn't catch windows new line after the comment. This one should work:
    /<!--(.|[\n\r\t])*?-->\r?\n?/g



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message