Open jsilvermist opened 7 years ago
@usergenic Shouldn't this not be parsed for bindings since it's inside a script
(also style
now too), and not be touched at all since it's a script with the type text/markdown
?
For reference, a similar issue has recently been fixed in the Polymer core with bindings: https://github.com/Polymer/polymer/pull/4841
For here, the simplest check would be to check the type
for text/javascript
and ignore if it is not.
Yeah this seems like something that needs work in PolymerAnalyzer, though it is unclear whether we want to ignore script tags or if a lower error severity would suffice. Thoughts, @rictic @justinfagnani ?
The Analyzer needs to match the semantics of Polymer itself. If Polymer is interpreting the [[ ... ]]
in the markdown above, then it's entirely correct for the Analyzer to complain about bad syntax.
Now that https://github.com/Polymer/polymer/pull/4841 is merged, the Analyzer needs to take that into account (though for what versions, or all versions, of Polymer is a good question).
An immediate workaround is to escape one of the left-square brackets as [
An immediate workaround is to escape one of the left-square brackets as
[
Doesn't work, it just shows up in the document as [
instead of [
.
Current workaround is far from ideal, which is to add a space, and then run a gulp script after polymer build like so:
'use strict';
const gulp = require('gulp');
const replace = require('gulp-replace');
gulp.task('default', () => {
// Transform backup-script post-build to bypass polymer-cli parse errors
return gulp.src('build/**/sl*backup-script.html')
.pipe(replace('if [ [', 'if [['))
.pipe(gulp.dest('build/'));
});
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm getting a
[polymer-expression-parse-error]
error I'm not really sure what to do about when trying to build with a file that looks like this:And when it gets to the part of:
It crashes with the error:
This all works fine except when trying to build, is there some way to ignore part of a file to prevent this parsing issue?