Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6680345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:27:52+00:00 2026-05-26T04:27:52+00:00

Back Story (not really important but it frames the question) I have a TagLib

  • 0

Back Story (not really important but it frames the question)

I have a TagLib in a JSP that takes its contents and wraps its containing code in a script block (it does much more but for the sake of the question it is not important). For example:

<aui:script use="some-module">
    //my code
</aui:script>

will be served as

<script type="text/javascript>
    AUI().use('sub-module', function(A) {
        // my code
    }
</script>

The Question

I would like all the code in between <aui:script use="things"></aui:script> and to have JavaScript syntax highlighting. So I tried editing the HTML.tmLanguage file to include this but Sublime Text 2 throws a fit.

Admittedly my regex knowledge is poor.

How can I edit HTML.tmLanguage to include my <aui:script /> taglib?

Site note, the taglib accepts various attributes like use and position.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:27:53+00:00Added an answer on May 26, 2026 at 4:27 am

    I have so much trouble with the regex rules but I managed to get it somewhat working using the normal rules. I should add that this is a new block, along with the regular one.

    {
        name = 'source.js.embedded.html';
        begin = '(?:^\s+)?(<)((?i:(aui[\:]script)))\b(?![^>]*/>)';
        end = '(?<=</(aui[\:]script))(>)(?:\s*\n)?';
        beginCaptures = {
            1 = { name = 'punctuation.definition.tag.html'; };
            2 = { name = 'entity.name.tag.script.html'; };
        };
        endCaptures = {
            2 = {
                name = 'punctuation.definition.tag.html';
            };
        };
        patterns = (
            {
                include = '#tag-stuff';
            },
            {
                begin = '(?<!</(?:aui[\:]script))(>)';
                end = '(</)((?i:aui[\:]script))';
                captures = {
                    1 = {
                        name = 'punctuation.definition.tag.html';
                    };
                    2 = {
                        name = 'entity.name.tag.script.html';
                    };
                };
                patterns = (
                    {   name = 'comment.line.double-slash.js';
                        match = '(//).*?((?=</(aui[\:]script))|$\n?)';
                        captures = {
                            1 = {
                                name = 'punctuation.definition.comment.js';
                            };
                        };
                    },
                    {
                        name = 'comment.block.js';
                        begin = '/\*';
                        end = '\*/|(?=</(aui[\:]script))';
                        captures = {
                            0 = {
                                name = 'punctuation.definition.comment.js';
                            };
                        };
                    },
                    {
                        include = '#php';
                    },
                    {
                        include = 'source.js';
                    },
                );
            },
        );
    }
    

    XML Format

    <dict>
        <key>begin</key>
        <string>(?:^\s+)?(&lt;)((?i:(aui[\:]script)))\b(?![^&gt;]*/&gt;)</string>
        <key>beginCaptures</key>
        <dict>
            <key>1</key>
            <dict>
                <key>name</key>
                <string>punctuation.definition.tag.html</string>
            </dict>
            <key>2</key>
            <dict>
                <key>name</key>
                <string>entity.name.tag.script.html</string>
            </dict>
        </dict>
        <key>end</key>
        <string>(?&lt;=&lt;/(aui[\:]script))(&gt;)(?:\s*\n)?</string>
        <key>endCaptures</key>
        <dict>
            <key>2</key>
            <dict>
                <key>name</key>
                <string>punctuation.definition.tag.html</string>
            </dict>
        </dict>
        <key>name</key>
        <string>source.js.embedded.html</string>
        <key>patterns</key>
        <array>
            <dict>
                <key>include</key>
                <string>#tag-stuff</string>
            </dict>
            <dict>
                <key>begin</key>
                <string>(?&lt;!&lt;/(?:aui[\:]script))(&gt;)</string>
                <key>captures</key>
                <dict>
                    <key>1</key>
                    <dict>
                        <key>name</key>
                        <string>punctuation.definition.tag.html</string>
                    </dict>
                    <key>2</key>
                    <dict>
                        <key>name</key>
                        <string>entity.name.tag.script.html</string>
                    </dict>
                </dict>
                <key>end</key>
                <string>(&lt;/)((?i:aui[\:]script))</string>
                <key>patterns</key>
                <array>
                    <dict>
                        <key>captures</key>
                        <dict>
                            <key>1</key>
                            <dict>
                                <key>name</key>
                                <string>punctuation.definition.comment.js</string>
                            </dict>
                        </dict>
                        <key>match</key>
                        <string>(//).*?((?=&lt;/(aui[\:]script))|$\n?)</string>
                        <key>name</key>
                        <string>comment.line.double-slash.js</string>
                    </dict>
                    <dict>
                        <key>begin</key>
                        <string>/\*</string>
                        <key>captures</key>
                        <dict>
                            <key>0</key>
                            <dict>
                                <key>name</key>
                                <string>punctuation.definition.comment.js</string>
                            </dict>
                        </dict>
                        <key>end</key>
                        <string>\*/|(?=&lt;/(aui[\:]script))</string>
                        <key>name</key>
                        <string>comment.block.js</string>
                    </dict>
                    <dict>
                        <key>include</key>
                        <string>#php</string>
                    </dict>
                    <dict>
                        <key>include</key>
                        <string>source.js</string>
                    </dict>
                </array>
            </dict>
        </array>
    </dict>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The story behind... I really like TV shows but I go back home only
back story: I am designing a portfolio website for myself. on its home page,
The Back Story I have some decimal values which I am displaying as strings
Straightforward question: I have a few variables that are doubles. I would like to
Not specifically a programming question, but might be something a bunch of programmers run
Let's say I have a javascript method that takes a little to long to
Ok, I have a question that I know is very opinionated (based on all
below is a code example and the question, please note that I can NOT
Backstory: I have a PKCS#12 (p12) certificate with a symmetric cipher (password) that I
Is it generally a really bad idea to not use the built-in asp.net membership

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.