Skip to content

CTAN.bib - @online parsed, but its comment #12929

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

Open
2 tasks done
Siedlerchr opened this issue Apr 13, 2025 · 7 comments · May be fixed by #12949
Open
2 tasks done

CTAN.bib - @online parsed, but its comment #12929

Siedlerchr opened this issue Apr 13, 2025 · 7 comments · May be fixed by #12949
Assignees

Comments

@Siedlerchr
Copy link
Member

JabRef version

6.0-alpha

Operating system

macOS

Details on version and operating system

mac os 15.5

Checked with the latest development build (copy version output from About dialog)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Download https://github.com/GuenterPartosch/Convert_CTAN/blob/master/output/CTAN.bib
  2. open in JabRef
  3. See that JabRef says it could not parse one entry

The problem is

% Type of BibLaTeX entries    : @online

The parser should skip this, maybe by checking only the first x columns for the @ sign

Appendix

...

Log File
Paste an excerpt of your log file here
@Zurtar
Copy link
Contributor

Zurtar commented Apr 15, 2025

/assign-me

@github-actions github-actions bot added the 📍 Assigned Assigned by assign-issue-action (or manually assigned) label Apr 15, 2025
Copy link
Contributor

👋 Hey @Zurtar, thank you for your interest in this issue! 🎉

We're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.

In case you encounter failing tests during development, please check our developer FAQs!

Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.

Happy coding! 🚀

@Zurtar Zurtar linked a pull request Apr 15, 2025 that will close this issue
6 tasks
@Zurtar
Copy link
Contributor

Zurtar commented Apr 15, 2025

I'm not sure what the solution would be, the parser can skip if its not within the first x columns like you suggested but that would end up skipping valid entries. For example, entries that have comments and the key on the same line:

@Test
void parseCommentAndEntryInOneLine() throws IOException {
    String bibtexEntry = """
            Some random comment that should stay here @Article{test,
              Author                   = {Foo Bar},
              Journal                  = {International Journal of Something},
              Note                     = {some note},
              Number                   = {1}
            }""";

	(...)
}

Maybe it could check if any entry is malformed and is missing its open/closing brackets regardless of comments? But then we'd just end up showing that same warning popup to the user.

@Siedlerchr
Copy link
Member Author

@koppor Any ideas?

@koppor
Copy link
Member

koppor commented Apr 16, 2025

Checking for validity is a nice idea.

I would be more straightforward:

A) Check if line starts with comment indicator string: %, #, --, *, // - and then treat the whole line as comment

B) Enforce Entries start at column 1 and adapt the test (and then call for user feedback on Mastodon etc)

Option A is more backwards compatible

@Zurtar
Copy link
Contributor

Zurtar commented Apr 19, 2025

A) Check if line starts with comment indicator string: %, #, --, *, // - and then treat the whole line as comment
Do comments have to start with those indicators? This test case shows one without it:

@Test
void parseCommentAndEntryInOneLine() throws IOException {
    String bibtexEntry = """
            Some random comment that should stay here @Article{test,
              Author                   = {Foo Bar},
              Journal                  = {International Journal of Something},
              Note                     = {some note},
              Number                   = {1}
            }""";
(...)
}

This would be valid, but if it had a comment indicator before it the parser would skip it. Which seems arbitrary. We could also just then have Type of BibLaTeX entries : @online and we'd get the original error.

@koppor
Copy link
Member

koppor commented Apr 19, 2025

A) Check if line starts with comment indicator string: %, #, --, *, // - and then treat the whole line as comment
Do comments have to start with those indicators? This test case shows one without it:

@Test
void parseCommentAndEntryInOneLine() throws IOException {
    String bibtexEntry = """
            Some random comment that should stay here @Article{test,
              Author                   = {Foo Bar},
              Journal                  = {International Journal of Something},
              Note                     = {some note},
              Number                   = {1}
            }""";
(...)
}

This would be valid, but if it had a comment indicator before it the parser would skip it. Which seems arbitrary. We could also just then have Type of BibLaTeX entries : @online and we'd get the original error.

Do you have another proposal?

We could use AI as fallback - if the user has enabled AI usage in JabRef.

Other than that, Option A seems to make things better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Normal priority
Development

Successfully merging a pull request may close this issue.

3 participants