core icon indicating copy to clipboard operation
core copied to clipboard

Could you please add .trim() to the FW alias network/host tokenizer?

Open dca00 opened this issue 1 month ago • 4 comments

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

  • [x ] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
  • [x ] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue

Is your feature request related to a problem? Please describe.

The tokenizer is 'dumb' in a sense that it tokenizes any input even if it includes tabs/spaces but later throws validation errors on save.

Describe the solution you like

If the input is trimmed before it is tokenized, user experience will improve because we will no longer have to go back, search for invalid tokens, delete them, and re-add them w/o blank spaces.

Describe alternatives you considered

N/A

Additional context

N/A

dca00 avatar Nov 21 '25 15:11 dca00

bigger fish to fry, not a priority right now. In the long run we should likely replace the tokenizer, but I think I already explained that in your other ticket.

AdSchellevis avatar Nov 21 '25 15:11 AdSchellevis

In which file could I add this myself?

dca00 avatar Nov 21 '25 15:11 dca00

this is the tokenizer we use https://dragonofmercy.github.io/Tokenize2/

AdSchellevis avatar Nov 21 '25 15:11 AdSchellevis

Could you point me at the actual file in which you call the methods of the tokenizer class and feed them the contents of the contents box? I am not a web developer, and it will take me a very long time to reverse-engineer the web UI.

dca00 avatar Nov 21 '25 16:11 dca00