pretty printed config.xml breaks plugin due to a regex #139
Labels
bug
Something isn't working properly
build issue
An issue related to build process
legacy
Related to inherited code/functionality
Bug report edited
I am not 100% sure this is a bug or just a feature request. Is just that it took me a lot to debug an issue.
I have some hooks and they rewrite config.xml and pretty print it...
If we pretty print the config.xml file and set the "name" this way:
The app breaks after adding platform with the error:
There is a quick solution to avoid this: use a library to indent that can indent "inline" elements.
In my case, I did the pretty printing this way, using the xml-formatter library:
With this library, I could correct it is as easyly as this:
However, I leave this issue open for reference. If you think it is not an issue or should be remove, please do it!
Steps to reproduce:
You can test it this way, create an empty app and edit the config.xml file to pretty print it as mentioned before.
I debug and see in the file
project-root/plugins/cordova-plugin-firebasex/scripts/after_prepare.js
, line 17, that we are searching for the string<name>blabla</name>
The
utilities.getValue(config, 'name')
calls the following function on utilities.js, wich returns null:I see the regex expression doesn't work multiline. I am not very good at regex and I am short of time now.... If I find a second I will try to come up with a regex that supports it...
The text was updated successfully, but these errors were encountered: