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
[Bug]: missing field breaks import #2377
Comments
I can see if I can make the parser robust against this, but in the sample you posted above you have
note the two commas, indicating a missing field. |
That's just not valid bibtex, both bibtex (renders with errors) and biblatex (does not render) complain about this input. |
That should not happen. Looking into that. You do currently have it set to |
Hi @retorquere, thanks for the reply. The double comma was always there and it was never a problem in previous versions of BBT. It happens because the bibtex creation routine in the browser is not able to extract the author on some pages. In any case, when BBT is disabled, it is not an issue for Zotero's "Import from Clipboard". Unfortunately I cannot tell you in which version this issue started because I have just noticed it now.; BBT must have updated several times before. About the selector, I usually have the |
This part of the parser hasn't changed in ages, I'm not sure why it surfaced only recently for you, but I'll see what I can do. |
Thanks @retorquere, let me know if you need me to make any more tests. |
🤖 this is your friendly neighborhood build bot announcing test build 6.7.46.3637 ("fixes #2377") Install in Zotero by downloading test build 6.7.46.3637, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...". |
Just tested test build 6.7.46.3637, but it did not solve the problem. I really don't think the issue is the empty field between commas, because Zotero and BBT were able to handle it previously. Just for completeness, here is the error I received when trying to "Import from Clipboard" with this build.
" |
The issue really is the extra comma, that's precisely what the error message is saying (look at the character in position 95 on the first line). What I don't know yet is how come I can import the input from the clipboard with 3637 and you can't. I could reproduce the problem on the release version on BBT, so for me there is really a difference between the two. |
Can you send a debug log from 3637? |
Just sent the debug log, ID 69NW7EPM-refs-euc. Also, I tested removing one of the commas where it is doubled, and you are right that the problem does not repeat. |
Do you have a sample for that underscore issue? |
Here you go, already without the double commas:
Do you need a gist? |
The underscore interpretation is correct-ish, bare underscores is not valid latex, and it looks like the stray underscore throws bibtex into math mode (where the underscore means subscript); try compiling this MWE:
|
No need for gist, the way you post them here quoted makes it easy for me to copy-paste them. |
I really have no idea how that came about for you, because this has been BBTs behavior going years back. |
I use overleaf too and I get the exact same output. Note the missing spaces and underscores, which is because latex is in math mode. |
A new build is underway that adds logging. When you have that installed, please import the double-comma sample and send a new debug log. |
Maybe Zotero changed something in the app, that now forces BBT to interpret the import differently... I could try to update/fix my HTML2BIBTEX routine in the browser, if you tell me what exactly should be the formatting that won't cause problems with the importing function... The only issue is that I can't really change the document titles and such... So the underscores will keep existing. |
Unlikely, it's just bare text, and I'm also on 6.0.19
I still want to fix the double-comma issue, the new log should help there. WRT the underscores, this table lists all characters that must be escaped: {
"#": {"math": "\\#", "text": "\\#"},
"$": {"math": "\\$", "text": "\\$"},
"%": {"math": "\\%", "text": "\\%"},
"&": {"math": "\\&", "text": "\\&"},
"/\u200b": {"text": "\\slash"},
"<": {"math": "<"},
">": {"math": ">"},
"\\": {"math": "\\backslash", "text": "\\textbackslash"},
"^": {"math": "\\sphat", "text": "\\^"},
"_": {"math": "\\_", "text": "\\_"},
"{": {"math": "\\lbrace", "text": "\\{"},
"}": {"math": "\\rbrace", "text": "\\}"},
"~": {"math": "\\sptilde", "text": "\\textasciitilde"},
}
That is unambiguously invalid latex though. And escaping these isn't really hard. If you want I can write a few lines of javascript that will do it for you.
I'd really prefer to fix it though. It really bugs me that I have it fixed locally but not for you. |
🤖 this is your friendly neighborhood build bot announcing test build 6.7.46.3638 ("add logging") Install in Zotero by downloading test build 6.7.46.3638, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...". |
First, I don't know what you changed in this last version, but it works well now. The problem that did not allow for the double comma disappeared. I am able to import again. I've sent you the log in any case, ID: 2FVFTJWG-refs-euc.
At the same time, as expected, the title issue remains. As I'd written up here, I use (an ad hoc modification of) this HTML2BIBLATEX snippet. Here's the bookmark I have saved in my browser, which unfortunately has to be a one-liner:
If it isn't much trouble to give me a solution for the underscores, I'd appreciate it. If it's too much effort, really nevermind. |
should do it. There's a few unused variables in that script. I've not touched them, but I don't see how they could be doing anything. |
literally only added a single line of logging
|
Hi @retorquere!
First, about the modifications in the last version. I don't know what happened, but I did have to restart Zotero twice more before sending you the latest logs with build 3638. So maybe the single Zotero restart with build 3637 was not enough for some reason. Cached settings, maybe? Don't know, but it is working just fine now, thanks again.
Second, about the bookmarklet modifications: thanks a lot for the help! I tried to use your improved version, but it was missing the I'll copy it down here for completeness:
Unfortunately, there is one problem still with the "Import from Clipboard" function. The field "Accessed" gets written as If you would prefer me to open a second issue instead, let me know and I'll transfer this last bit. Thanks again, |
I don't think that would work, you're applying my text2latex after doing your own tex conversions, and those backslashes that end up in title_tex would end up escaped. tltle_tex should be removed entirely.
This is not the problem BTW. It's just an import error, import from clipboard just calls the importer. The same problem would occur if the same content were imported from a file.
Translators cannot set the |
Debug log ID
J2GQXW4D-refs-euc
What happened?
The function "Import from Clipboard" stopped working for me. Currently using Zotero 6.0.19, and disabling BetterBibTeX makes the function work again.
I semi-automatically create items using this function and lines of text created automatically by the browser, such as the example below:
Now, when attempting an import, Zotero creates a note instead with comments such as:
"
Import errors found:
"
Just to be clear, the found error is not always the same.
I already tried selecting "no" in both "Sentence-case titles on import" and "Insert case-protection for braces", but it does not change the problem. I did notice, however, that after attempting an import the selector for "Sentence-case titles on import" automatically changes to "yes".
Any ideas how to remedy this?
The text was updated successfully, but these errors were encountered: