Closed dspjm closed 2 years ago
For me it works as expected in the browser.
I need more details
I just try it again and it works. However, the problem is it cannot remove the trailing
at the end of the field. I remember it used to remove that one, so is it changed that it won't remove the trailing
?
However, the problem is it cannot remove the trailing at the end of the field. I remember it used to remove that one, so is it changed that it won't remove the trailing ?
I don't have this problem with the code I process. Give some html source code where it doesn't work expected. I changed how this add-on works about a month ago which might explain why it works differently.
However, the problem is it cannot remove the trailing at the end of the field. I remember it used to remove that one, so is it changed that it won't remove the trailing ?
I don't have this problem with the code I process. Give some html source code where it doesn't work expected. I changed how this add-on works about a month ago which might explain why it works differently.
Thanks. Try this "The Goldilocks Rule<br>
" in the Front field.
I can confirm that the trailing "
" is not removed from a field with the content The Goldilocks Rule<br>
I haven't really looked into it but it doesn't seem like a quick fix. For me this trailing slash has no visual effect so I don't care about it at the moment.
Does it have a visual effect for you? show screenshots.
Does it have a visual effect for you? show screenshots.
Well, it has an extra empty line between the questions and answers, and it may hide some notes I wrote in addition to looking wired. Because I basically copy from pdf, the trailing newline was always there, so I have to remove it by hand every time now. It would be great if this can be improved. Thanks.
I am trying to work on the code myself, while I am not sure why line 56:
.replace(/<br>/g, ' ')
is not removing the trailing <br>
?
I think a fix can be
if (string.endsWith('<br>')))
string.slice(0, -4)
What do you think?
Thanks for looking into this. My js and html knowledge is very limited. So I have no idea why the regex you mentioned in your first post from today doesn't work. If the second post works that's great. I have no idea if there could be side effects etc. I suggest you test it for a week or two. If you don't run into any problems I could upload it to ankiweb.
at least since Anki 2.1.41 from 2021-03-07 a trailing <br>
seems to be removed by my add-on with the existing code, version from 2022-09.
Cannot remove
when editing in browser.