Skip to content

References don't work and make all text containing a slash / to be treated as a reference #645

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

Closed
agamez opened this issue Mar 5, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@agamez
Copy link
Contributor

agamez commented Mar 5, 2021

On version 0.8.3, having ingredients lists such as "1/2 kg of tomatoes", now appears as "1undefined2kg of tomatoes".

Entering a properly formatted reference as, for example, #r/2540402 (real ID of a recipe of mine) results in the recipe viewer as appearing
"<a class="recipe-reference-inline" href="undefinednextcloudundefinedindex.phpundefinedappsundefinedcookbookundefined#undefinedrecipeundefined2540402">#2540402<undefineda> "

Also, the popup with the list of references appears not only when writing #, but also when entering a 3 in which # character is located too (but not with the numeric keyboard).

Main problem, however, is it treating every / occurance as a reference to undefined, as this is breaking already existing functionality.

@agamez agamez added the bug Something isn't working label Mar 5, 2021
@seyfeb
Copy link
Collaborator

seyfeb commented Mar 5, 2021

To make sure I understand you correctly: Whenever you press the button for entering a '3', the recipe-selection pop-up opens?

Otherwise duplicate of #641

@agamez
Copy link
Contributor Author

agamez commented Mar 5, 2021

That is correct. Typing a 3 (key above 'e') launches the pop-up. Typing a 3 (on the numeric keyboard above '.' and to the left of Intro) does not launch the pop-up.

Please, review my original message which I've editted to properly show that there appears HTML output on recipe view, so it's not only the / -> undefined of #641, but also spurious HTML appearing out of nowhere.

Thanks!

@christianlupus
Copy link
Collaborator

This is due to the check for keycode in the EditInputField.vue file.

I am not sure if the keycode approach is so well suited. The hash has only keycode 51 on the US keyboard. Other layouts have the hash on different keys with different keycodes. On the German (for example) it is 163, while 51 is 3/§.
Wouldn't it be more feasible to let the browser type the symbol and later check the textual representation of the lastly typed glyph?

@seyfeb
Copy link
Collaborator

seyfeb commented Mar 6, 2021

I see! This should definitely be changed to work on any keyboard layout.

@seyfeb
Copy link
Collaborator

seyfeb commented Mar 7, 2021

This can be closed if #648 and #642 solved the problems.

@christianlupus
Copy link
Collaborator

I am closing here as the PRs should have taken care of the issue.

If the problem still persists, we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants