Sublime Forum

XML Syntax Highlighting in Build 3103

#1

When I open an SVG file the syntax is quite often not highlighted properly. And when I open a certain SVG file Sublime 3 completely stops working. You can find the file here: https://www.dropbox.com/s/ucgt5krs8fq8xqz/member-ixda.svg?dl=1

0 Likes

#2

seems fine in build 3112:

0 Likes

#3

I’m also having this issue with some SVGs in build 3114. As soon as I switch to XML highlighting Sublime Text crashes.

This one crashes:

<svg width="47px" height="96px" viewBox="472 471 47 96" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <defs>
        <polygon id="path-1" points="0.466357769 95 46.9985122 95 46.9985122 0.9344 0.466357769 0.9344 0.466357769 95"></polygon>
    </defs>
    <g id="Group-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(472.000000, 471.000000)">
        <g id="Group-161" transform="translate(0.000000, 0.911000)">
            <mask id="mask-2" fill="white">
                <use xlink:href="#path-1"></use>
            </mask>
            <g id="Clip-160"></g>
            <path d="M41.2657,89.8264 C41.4467,89.7214 41.5487,89.6984 41.5707,89.6444 C43.4217,85.0714 43.0707,80.2484 43.1167,75.4814 C43.1267,74.4104 42.0957,74.1204 40.1917,74.3254 C39.0097,74.4534 39.3197,75.2364 39.3977,75.9134 C39.9027,80.2674 40.4197,84.6194 40.9477,88.9714 C40.9827,89.2574 41.1517,89.5284 41.2657,89.8264 L41.2657,89.8264 Z M12.8297,91.3144 C13.2717,90.1674 13.6137,89.5474 13.7477,88.8834 C14.2567,86.3834 14.7307,83.8744 15.1527,81.3574 C15.4307,79.7054 15.6047,78.0354 15.8097,76.3724 C15.8877,75.7324 15.6897,75.2404 14.9437,75.2334 C13.5057,75.2184 12.0667,75.2114 10.6287,75.2444 C9.9387,75.2604 9.6457,75.7094 9.7127,76.3714 C9.7447,76.6864 9.8607,76.9914 9.9237,77.3044 C10.6787,81.0624 11.4277,84.8214 12.1887,88.5784 C12.3397,89.3214 12.5337,90.0564 12.8297,91.3144 L12.8297,91.3144 Z M23.0437,53.3854 C23.0447,53.4204 23.0447,53.4554 23.0457,53.4914 C24.2437,53.4914 25.4437,53.5254 26.6417,53.4844 C30.8707,53.3404 35.1007,53.1974 39.3287,52.9974 C40.8717,52.9244 41.0597,52.6384 40.9907,51.0684 C40.9027,49.0764 40.8067,47.0844 40.6947,45.0934 C40.6327,43.9764 40.6207,42.8454 40.4287,41.7484 C39.7517,37.8694 39.7997,37.1544 34.8437,36.8814 C30.7607,36.6574 26.7167,37.0354 22.6607,37.5344 C19.1057,37.9704 15.5207,38.4004 11.9177,37.8744 C10.3377,37.6434 8.7467,37.4824 7.1587,37.3104 C6.2767,37.2144 5.7847,37.6134 5.7817,38.5264 C5.7807,38.9254 5.7837,39.3284 5.8287,39.7244 C6.2767,43.6944 6.7487,47.6614 7.1757,51.6334 C7.2657,52.4684 7.6197,52.9714 8.4447,53.1264 C8.9157,53.2154 9.3877,53.3714 9.8607,53.3734 C14.2547,53.3934 18.6497,53.3854 23.0437,53.3854 L23.0437,53.3854 Z M41.5437,17.6104 C41.5437,16.5764 41.5937,15.5414 41.5337,14.5134 C41.3697,11.7254 41.2597,8.9274 40.9347,6.1564 C40.6827,4.0104 40.2867,3.7724 38.2037,3.6594 C32.8687,3.3724 27.5357,2.9754 22.1967,2.8474 C16.2117,2.7044 10.2207,2.8074 4.2327,2.8074 C3.8337,2.8074 3.4337,2.8254 3.0357,2.8554 C2.3417,2.9074 2.0627,3.3094 2.1197,3.9804 C2.2407,5.4124 2.3337,6.8464 2.4857,8.2744 C2.6887,10.1764 2.9527,12.0714 3.1617,13.9734 C3.2937,15.1724 3.8877,15.8394 5.1187,15.9874 C8.8397,16.4344 12.5467,17.2014 16.2767,17.3234 C22.9767,17.5444 29.6897,17.3724 36.3977,17.3964 C38.0537,17.4024 39.7087,17.5304 41.5437,17.6104 L41.5437,17.6104 Z M40.5747,36.6974 C40.7427,36.3974 40.9387,36.2024 40.9567,35.9924 C41.3177,31.7024 41.9507,27.4154 41.2647,23.1024 C41.1137,22.1584 40.8867,21.2244 40.6597,20.2944 C40.4657,19.5014 39.9227,19.0904 39.1087,19.0464 C38.6297,19.0214 38.1507,18.9864 37.6727,18.9874 C32.8807,18.9964 28.0857,19.1134 23.2967,18.9944 C19.0737,18.8894 14.8537,18.5714 10.6407,18.2484 C8.7357,18.1024 6.8497,17.7144 4.9547,17.4414 C4.2627,17.3414 3.8807,17.6364 3.8737,18.3494 C3.8697,18.7484 3.8827,19.1474 3.9117,19.5454 C4.1867,23.2874 4.5927,27.0244 4.7147,30.7704 C4.8807,35.8974 6.2427,35.9254 10.3037,36.4194 C14.9337,36.9814 19.5727,36.5524 24.1377,35.8214 C27.3227,35.3114 30.4797,35.1644 33.6717,35.2654 C36.0407,35.3404 38.4187,35.4334 40.5747,36.6974 L40.5747,36.6974 Z M37.6167,70.7564 C38.3907,72.9134 40.0057,72.8564 41.6267,72.7954 C42.1057,72.7774 42.5867,72.8074 43.0637,72.7744 C44.7257,72.6584 45.0277,72.4414 45.0957,70.7734 C45.2337,67.4234 45.3427,64.0694 45.3097,60.7184 C45.2967,59.3814 44.9617,58.0264 44.6217,56.7194 C44.2377,55.2474 43.9787,55.1784 42.4397,55.4454 C42.1007,55.5044 41.5547,55.5154 41.4017,55.3184 C40.6707,54.3744 39.6867,54.5834 38.7567,54.6394 C37.6437,54.7064 36.5387,54.9714 35.4287,54.9834 C31.0367,55.0304 26.6447,55.0664 22.2537,55.0024 C18.5037,54.9474 14.7567,54.7134 11.0067,54.6254 C7.4057,54.5404 6.9797,54.9754 6.7307,58.6134 C6.7247,58.6924 6.7197,58.7734 6.7237,58.8524 C6.8897,62.9194 7.0157,66.9894 7.2447,71.0524 C7.3417,72.7664 7.5557,73.0554 9.1467,73.3114 C11.6487,73.7124 14.1847,74.1534 16.6817,73.1584 C17.0217,73.0234 17.4377,73.0654 17.8197,73.0544 C20.5227,72.9744 23.2417,73.0554 25.9257,72.7844 C28.7847,72.4954 31.6107,71.8814 34.4827,72.5964 C35.9527,72.9624 36.9077,72.3484 37.6167,70.7564 L37.6167,70.7564 Z M12.9347,0.9344 C16.9247,1.0954 20.9137,1.2664 24.9047,1.4124 C27.4597,1.5064 30.0177,1.5384 32.5727,1.6434 C34.8847,1.7384 37.1937,1.9074 39.5047,2.0194 C40.6957,2.0774 41.5017,2.6864 41.8097,3.7784 C42.1767,5.0784 42.5247,6.4134 42.6257,7.7524 C43.0317,13.0864 43.3797,18.4144 42.9257,23.7814 C42.5227,28.5484 42.3947,33.3414 42.2777,38.1264 C42.2257,40.2704 42.5317,42.4214 42.6067,44.5714 C42.6517,45.8384 42.5847,47.1114 42.5287,48.3794 C42.4937,49.1734 42.4087,49.9654 42.3087,50.7544 C42.1177,52.2684 42.4657,53.4084 44.1237,53.8954 C45.2057,54.2134 45.6717,55.1504 46.0947,56.1514 C47.1927,58.7534 46.9977,61.4804 46.9637,64.1844 C46.9357,66.3394 46.7337,68.4914 46.6697,70.6464 C46.6347,71.7984 46.4607,72.9074 45.7127,73.7934 C44.8667,74.7944 44.8157,75.9634 44.7047,77.1624 C44.3947,80.5014 44.1457,83.8504 43.6697,87.1664 C43.3427,89.4474 42.7047,91.6854 42.1407,93.9254 C42.0397,94.3244 41.6227,94.6444 41.3517,95.0004 C41.0097,94.6174 40.4297,94.2704 40.3657,93.8454 C39.9367,91.0054 39.6237,88.1474 39.2607,85.2974 C38.8767,82.2894 38.5567,79.2704 38.0587,76.2814 C37.7487,74.4214 37.6207,74.4574 35.7567,74.1594 C32.8937,73.7024 30.0577,73.7364 27.1757,74.1644 C24.6567,74.5384 22.0807,74.5174 19.5327,74.7174 C17.5567,74.8734 17.3687,74.9794 17.0597,76.9304 C16.5967,79.8464 16.4517,82.8224 15.8447,85.7044 C15.3067,88.2614 14.3437,90.7314 13.5127,93.2214 C13.4067,93.5374 12.8437,94.0094 12.7057,93.9454 C12.3337,93.7744 11.8857,93.3934 11.8077,93.0244 C11.3107,90.6824 10.9387,88.3144 10.4637,85.9684 C9.8137,82.7614 9.1427,79.5584 8.3957,76.3734 C8.2447,75.7254 7.8347,75.0334 7.3387,74.5924 C6.5507,73.8934 6.2007,73.0784 6.1267,72.0874 C5.9367,69.5414 5.7497,66.9944 5.5717,64.4474 C5.4097,62.1374 5.2877,59.8244 5.0947,57.5184 C5.0057,56.4574 5.0287,55.4814 5.6457,54.5354 C6.3407,53.4684 6.1977,52.2734 6.0187,51.0544 C5.5197,47.6604 5.1157,44.2534 4.6627,40.8534 C4.0957,36.5914 4.1787,32.2724 3.4117,28.0214 C3.0027,25.7504 3.0027,23.4094 2.7407,21.1084 C2.6077,19.9334 2.3047,18.7774 2.0767,17.6134 C2.0157,17.3044 1.8467,16.9774 1.8997,16.6894 C2.5177,13.2914 1.2737,10.0434 1.1067,6.7094 C1.0437,5.4414 0.7287,4.1854 0.5277,2.9244 C0.3447,1.7734 0.5287,1.4444 1.6637,1.3414 C3.0147,1.2174 4.3767,1.1794 5.7347,1.1644 C8.1327,1.1384 10.5307,1.1574 12.9287,1.1574 L12.9347,0.9344 Z" id="Fill-159" fill="#000000" mask="url(#mask-2)"></path>
        </g>
        <path d="M37.6164,71.6678 C36.9074,73.2588 35.9524,73.8738 34.4824,73.5078 C31.6104,72.7928 28.7854,73.4068 25.9264,73.6958 C23.2424,73.9668 20.5224,73.8848 17.8194,73.9658 C17.4374,73.9768 17.0214,73.9338 16.6824,74.0688 C14.1844,75.0648 11.6484,74.6238 9.1464,74.2218 C7.5554,73.9668 7.3414,73.6778 7.2444,71.9628 C7.0154,67.8998 6.8894,63.8308 6.7234,59.7638 C6.7204,59.6838 6.7244,59.6038 6.7304,59.5238 C6.9794,55.8868 7.4054,55.4518 11.0074,55.5358 C14.7564,55.6238 18.5034,55.8578 22.2534,55.9128 C26.6444,55.9778 31.0374,55.9418 35.4284,55.8938 C36.5384,55.8818 37.6444,55.6168 38.7564,55.5498 C39.6874,55.4938 40.6704,55.2848 41.4024,56.2298 C41.5544,56.4268 42.1004,56.4158 42.4394,56.3568 C43.9794,56.0898 44.2384,56.1588 44.6214,57.6308 C44.9614,58.9378 45.2964,60.2928 45.3094,61.6298 C45.3424,64.9808 45.2334,68.3348 45.0954,71.6838 C45.0274,73.3528 44.7254,73.5698 43.0634,73.6858 C42.5864,73.7188 42.1054,73.6888 41.6264,73.7068 C40.0054,73.7678 38.3904,73.8238 37.6164,71.6678" id="Fill-162" fill="#DF2D1C" class="icon__color"></path>
        <path d="M40.5751,37.6083 C38.4181,36.3443 36.0411,36.2513 33.6711,36.1763 C30.4791,36.0753 27.3231,36.2223 24.1371,36.7323 C19.5731,37.4633 14.9331,37.8923 10.3031,37.3303 C6.2431,36.8363 4.8811,36.8083 4.7141,31.6813 C4.5931,27.9353 4.1861,24.1983 3.9121,20.4563 C3.8821,20.0583 3.8701,19.6593 3.8741,19.2603 C3.8801,18.5473 4.2631,18.2523 4.9541,18.3523 C6.8491,18.6253 8.7361,19.0133 10.6401,19.1593 C14.8541,19.4823 19.0741,19.8003 23.2961,19.9053 C28.0851,20.0253 32.8801,19.9073 37.6721,19.8983 C38.1511,19.8983 38.6301,19.9323 39.1081,19.9583 C39.9221,20.0023 40.4661,20.4123 40.6591,21.2053 C40.8861,22.1353 41.1141,23.0693 41.2641,24.0133 C41.9501,28.3263 41.3171,32.6133 40.9571,36.9033 C40.9391,37.1133 40.7431,37.3083 40.5751,37.6083" id="Fill-164" fill="#DF2D1C" class="icon__color"></path>
        <path d="M41.5433,18.5215 C39.7083,18.4415 38.0533,18.3125 36.3973,18.3075 C29.6893,18.2835 22.9773,18.4545 16.2763,18.2345 C12.5473,18.1115 8.8403,17.3455 5.1193,16.8985 C3.8873,16.7505 3.2933,16.0835 3.1613,14.8845 C2.9523,12.9825 2.6893,11.0875 2.4863,9.1855 C2.3333,7.7575 2.2403,6.3235 2.1193,4.8915 C2.0633,4.2205 2.3413,3.8175 3.0363,3.7665 C3.4333,3.7365 3.8333,3.7175 4.2323,3.7175 C10.2203,3.7185 16.2113,3.6155 22.1963,3.7585 C27.5353,3.8865 32.8683,4.2835 38.2033,4.5705 C40.2863,4.6825 40.6823,4.9205 40.9343,7.0675 C41.2593,9.8385 41.3703,12.6355 41.5333,15.4245 C41.5943,16.4525 41.5433,17.4875 41.5433,18.5215" id="Fill-166" fill="#DF2D1C" class="icon__color"></path>
        <path d="M23.0439,54.2961 C18.6489,54.2961 14.2549,54.3041 9.8599,54.2851 C9.3879,54.2831 8.9159,54.1271 8.4449,54.0381 C7.6199,53.8821 7.2659,53.3801 7.1759,52.5441 C6.7489,48.5721 6.2769,44.6051 5.8289,40.6351 C5.7839,40.2391 5.7799,39.8371 5.7819,39.4371 C5.7849,38.5241 6.2769,38.1251 7.1589,38.2211 C8.7469,38.3931 10.3379,38.5541 11.9179,38.7851 C15.5209,39.3111 19.1059,38.8821 22.6609,38.4451 C26.7159,37.9471 30.7609,37.5681 34.8439,37.7931 C39.7999,38.0651 39.7519,38.7801 40.4289,42.6591 C40.6199,43.7571 40.6329,44.8871 40.6949,46.0041 C40.8069,47.9951 40.9019,49.9871 40.9909,51.9791 C41.0599,53.5491 40.8709,53.8351 39.3279,53.9081 C35.1009,54.1081 30.8709,54.2521 26.6409,54.3961 C25.4439,54.4361 24.2439,54.4021 23.0449,54.4021 C23.0449,54.3671 23.0439,54.3311 23.0439,54.2961" id="Fill-168" fill="#DF2D1C" class="icon__color"></path>
        <path d="M12.8293,92.2255 C12.5333,90.9675 12.3393,90.2325 12.1893,89.4895 C11.4283,85.7325 10.6793,81.9735 9.9233,78.2155 C9.8603,77.9025 9.7453,77.5975 9.7133,77.2825 C9.6453,76.6205 9.9383,76.1705 10.6293,76.1555 C12.0663,76.1225 13.5063,76.1295 14.9443,76.1445 C15.6893,76.1515 15.8883,76.6435 15.8093,77.2835 C15.6043,78.9465 15.4303,80.6165 15.1533,82.2685 C14.7303,84.7845 14.2563,87.2935 13.7483,89.7945 C13.6133,90.4575 13.2713,91.0785 12.8293,92.2255" id="Fill-170" fill="#DF2D1C" class="icon__color"></path>
        <path d="M41.2657,90.7374 C41.1517,90.4394 40.9827,90.1684 40.9477,89.8824 C40.4197,85.5304 39.9027,81.1784 39.3977,76.8244 C39.3197,76.1474 39.0097,75.3644 40.1917,75.2364 C42.0957,75.0314 43.1267,75.3214 43.1167,76.3924 C43.0707,81.1594 43.4217,85.9824 41.5707,90.5554 C41.5487,90.6094 41.4467,90.6324 41.2657,90.7374" id="Fill-172" fill="#DF2D1C" class="icon__color"></path>
    </g>
</svg>

This one works:

<svg width="49px" height="54px" viewBox="411 162 49 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <defs></defs>
    <g id="Group-7" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(411.000000, 162.000000)">
        <g id="Group-4">
            <path d="M2.3583,17.581 C2.4193,21.897 3.1183,25.954 4.9053,29.951 C6.9533,34.535 9.6823,38.632 12.6963,42.563 C14.7343,45.222 16.9583,47.774 20.0143,49.377 C25.4623,52.236 31.0733,53.674 37.0093,50.942 C41.9443,48.669 45.5323,45.163 46.0013,39.461 C46.2343,36.619 46.1103,33.703 45.7633,30.868 C44.9793,24.457 41.9583,18.875 38.7493,13.412 C36.6373,9.817 33.8143,6.938 29.8983,5.269 C26.3543,3.757 22.7823,2.438 18.8173,2.611 C17.0713,2.688 15.1943,2.874 13.5893,2.355 C11.1553,1.568 9.2673,2.008 7.4543,3.619 C5.2233,5.601 3.7673,8.076 3.1553,10.947 C2.6943,13.117 2.6103,15.367 2.3583,17.581 M0.6193,17.419 C1.2283,14.546 1.5923,11.594 2.5053,8.821 C3.7723,4.967 6.1863,1.921 10.2473,0.618 C11.0343,0.365 11.9593,0.42 12.8053,0.499 C14.6203,0.67 16.4233,1.133 18.2333,1.149 C24.1643,1.202 29.5213,2.988 34.4433,6.194 C37.1363,7.949 38.8393,10.612 40.4133,13.286 C43.2913,18.173 45.9823,23.16 47.1483,28.814 C48.0283,33.079 48.4463,37.305 47.3543,41.615 C46.4913,45.021 44.7503,47.764 41.9303,49.822 C36.6353,53.686 30.9363,54.897 24.5263,52.885 C19.5343,51.318 15.4643,48.521 12.2513,44.527 C8.9973,40.483 6.1093,36.187 3.8903,31.437 C1.8093,26.983 0.9933,22.347 0.6193,17.419" id="Fill-9" fill="#000000"></path>
            <path d="M2.3583,17.581 C2.6103,15.367 2.6943,13.117 3.1553,10.947 C3.7673,8.076 5.2233,5.601 7.4543,3.619 C9.2673,2.008 11.1553,1.568 13.5893,2.355 C15.1943,2.874 17.0713,2.688 18.8173,2.611 C22.7823,2.438 26.3543,3.757 29.8983,5.269 C33.8143,6.938 36.6373,9.817 38.7493,13.412 C41.9583,18.875 44.9793,24.457 45.7633,30.868 C46.1103,33.703 46.2343,36.619 46.0013,39.461 C45.5323,45.163 41.9443,48.669 37.0093,50.942 C31.0733,53.674 25.4623,52.236 20.0143,49.377 C16.9583,47.774 14.7343,45.222 12.6963,42.563 C9.6823,38.632 6.9533,34.535 4.9053,29.951 C3.1183,25.954 2.4193,21.897 2.3583,17.581" id="Fill-11" fill="#9CEDFF" class="icon__color"></path>
        </g>
    </g>
</svg>

0 Likes

#4

Also works fine for me (tested on 3113 on Windows 7 x64). What platform are you on? Does it still crash without any packages installed?

0 Likes

#5

I’m on Mac OS X 10.11.4

I narrowed it down to a plugin called BracketHighlighter that was causing the issue in my case https://github.com/facelessuser/BracketHighlighter. I’ll open an issue on the repo. Thanks!

0 Likes

#6

I wonder if it can be narrowed down further by line length? Maybe any (XML) files with lines over a certain size cause it?

0 Likes

#7

I will need to confirm reproducibility first.

0 Likes

#8

I found the issue. The attribute regex for xml/xhtml was weird. As a temporary workaround you can set the following setting in bh_tag.sublime-settings:

    // HTML attributes.  Do not use capturing groups.
    "attributes":
    {
        "xhtml": "[\\w\\-:]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'))?",
        "html": "[\\w\\-:]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s\"'`=<>]+))?",
        "cfml": "[\\w\\-\\.:]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s\"'`=<>]+))?"
    },

I’m not sure why it wasn’t this to begin with. Probably something I missed. This will be fixed soon.

2 Likes

#9

The following release fixes the issue: https://github.com/facelessuser/BracketHighlighter/releases/tag/st3-2.14.2. As soon as it is available in Package Control, you should be able to upgrade.

0 Likes