Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot handle escape strings #31

Closed
faizansaiyed opened this issue Apr 24, 2018 · 3 comments
Closed

Cannot handle escape strings #31

faizansaiyed opened this issue Apr 24, 2018 · 3 comments

Comments

@faizansaiyed
Copy link

In my Menu Json, I'm storing:

[
   {
      "id":2,
      "title":"sddsd",
      "customSelect":"search.html?SearchSensor=\"flags-of-the-world\"",
      "__domenu_params":{

      },
      "select2ScrollPosition":{
         "x":0,
         "y":0
      }
   },
   {
      "id":1,
      "title":"Home",
      "customSelect":"index.html",
      "__domenu_params":{

      },
      "select2ScrollPosition":{
         "x":0,
         "y":0
      }
   }
]

So when dynamically rendering this JSON into DoMenu, I'm getting this error:

jquery.min.js:2 Uncaught Error: Syntax error, unrecognized expression: option[value="search.html?SearchSensor="flags-of-the-world""]
    at Function.ga.error (jquery.min.js:2)
    at ga.tokenize (jquery.min.js:2)
    at Function.ga [as find] (jquery.min.js:2)
    at r.fn.init.find (jquery.min.js:2)
    at HTMLSelectElement.eval (jquery.domenu-0.99.77.js?5dd7:573)
    at Function.each (jquery.min.js:2)
    at r.fn.init.each (jquery.min.js:2)
    at Plugin.setInputCollectionPlaceholders (jquery.domenu-0.99.77.js?5dd7:570)
    at Plugin.createNewListItem (jquery.domenu-0.99.77.js?5dd7:649)
    at processItem (jquery.domenu-0.99.77.js?5dd7:838)
@mechanicious
Copy link
Owner

mechanicious commented Apr 24, 2018

Why don't you just use "customSelect":"search.html?SearchSensor=flags-of-the-world"? These extra quotation marks in the URL are unnecessary.

@faizansaiyed
Copy link
Author

This double quotes are necessary for ReactiveSearch filters. Is it possible that DoMenu processes all escape characters?

@mechanicious
Copy link
Owner

mechanicious commented Apr 25, 2018

Try to HTML-escape these symbols, use " instead of the quotation marks "search.html?SearchSensor="flags-of-the-world"",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants