NativeScript / nativescript-dev-webpack

A package to help with webpacking NativeScript apps.
Apache License 2.0
97 stars 49 forks source link

Version 1.3.0 - shows a warning: Invalid character in entity name #1106

Closed kdagithub closed 4 years ago

kdagithub commented 4 years ago

Environment

Describe the bug WARNING in ./main-page.xml Module Warning (from ../node_modules/nativescript-dev-webpack/xml-namespace-loader.js): Invalid character in entity name Line: 41 Column: 52 Char: & @ \b_[\w-]*\.)scss)$ (. sync (?<!\bApp_Resources\b.*)(?<!\.\/\btests\b\/.*?)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$) ./main-page.xml @ ./app.js

The cause for the warning is the character '&' in the dataBinding logical comparison expression: (message != null && message.length > 0)

The expression should be valid according to the docs: Supported Expressions

To Reproduce tns run android

Expected behavior The warning was not shown in version 1.2.0 and should be valid.

Sample project actionbartest.zip

NickIliev commented 4 years ago

From the documentation link that you've posted I've noticed the following note:

Note: Special characters need to be escaped as follows:

  • " &quot;
  • ' &apos;
  • < &lt;
  • > &gt;
  • & &amp;

Try the following

<Label text="{{ message, (message != null &amp;&amp; message.length > 0) ? message : 'nope', false }}" class="h2 text-center" textWrap="true"/>