bootlin / elixir

The Elixir Cross Referencer
GNU Affero General Public License v3.0
967 stars 143 forks source link

DT compatible search fails when comma is present, mangles the search string #309

Closed lucaceresoli closed 1 month ago

lucaceresoli commented 1 month ago

DT compatible search is currently broken when searching for a DT compatible string that contains a comma (which is frequent!), and perhaps other symbols that need escaping in HTML.

Steps to reproduce:

  1. goto elixir.bootlin.com (currently redirects to https://elixir.bootlin.com/linux/v6.10.2/source)
  2. in the drop-down list close to the "Search identifier" field, select the "DT compatible" search type
  3. in the "Search identifier" field enter fsl,imx6q-usdhc
  4. press enter or click on the magnifying lens

2 errors in the result page:

fstachura commented 1 month ago

I was just about to post about this :). Here is another example https://elixir.bootlin.com/zephyr/v3.7.0/source/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dtsi#L13

What's interesting is that the popup seems to work. Replacing %2C with a comma in the search bar causes "Identifier is invalid" - commas are indeed not allowed here. The search string is the same in the old version.

The identifier is probably unquoted to early. Dts database stores identifiers in quoted form.

Overall, the escaping situation is not very clear and needs some more work. I will try to figure out how to easily fix this first though.

lucaceresoli commented 1 month ago

Thanks @fstachura (and @tleb) for the very quick fix!