susam / mathb

Share mathematics on the web with LaTeX and Markdown

Home Page:https://mathb.in/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: improper code

sergeevabc opened this issue · comments

  • Browser: Supermium 118 (Chromium based)
  • Text to paste:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu sem placerat, dapibus massa eu, consectetur orci. Fusce ultrices blandit ante a ullamcorper. Phasellus pellentesque est sed ligula bibendum, ac lobortis enim sollicitudin. Nunc tincidunt leo in sapien tincidunt volutpat. Vestibulum metus lectus, rutrum non arcu a, molestie rhoncus metus. Etiam ornare dolor mauris, et scelerisque urna pharetra ac. Aenean feugiat porta nulla eu tristique. Aliquam sed elit auctor, dignissim neque hendrerit, finibus ipsum. Interdum et malesuada fames ac ante ipsum primis in faucibus.

  • Save and get URL
  • ERROR: Improper code!

Why?

Hi @sergeevabc, The online service running at https://mathb.in/ expects the input code to contain some LaTeX mathematics delimiter. When no such delimiter is found, an error is returned. See also #29.

@susam, it is NOT obvious, consider adding a tip or, at least, a more meaningful error message. For example, the frontpage says Mathbin is for math snippets. Okay, let's expand 'lorem ipsum' (looks proper Markdown to me) with '2+2=4' (not LaTeX, still proper math), yet 'Improper code' error again.

Otherwise, one has to use hacks like @enzotib did.

You lucky, I waited more than two months to get an answer I already found by myself

Hi @sergeevabc, Thank you for the feedback. There are currently mainly two reasons why the error message for this specific error is unclear.

  • The error message (see https://github.com/susam/mathb/blob/b15f3c8/mathb.lisp#L439-L440) is not configurable. However, the condition for generating this error message is configurable via the :expect configuration option documented at https://github.com/susam/mathb#runtime-options. For example, the live instance running at https://mathb.in/ is configured to generate this error when LaTeX delimiters are missing. However, someone else running a separate instance of MathB may configure it to generate an error when a different set of tokens is missing from the post. It is also possible to configure MathB to not generate this error at all.

  • Keeping the error message unclear also reduces drive-by spamming to some extent. Pastebins like this face significant spamming problem. The measures to discourage spam in MathB.in have evolved over many years. The "improper code" error message was one of the things that had a positive correlation with reduced spam.

I have to admit though that these are really mundane reasons for keeping an unclear message. A clearer error message will certainly be helpful to genuine authors of a post. The unclear error message can indeed be frustrating. The error message can definitely be made configurable, so that as one configures the :expect option, they can configure the corresponding error message too. However, this is a volunteer driven open source project and this particular issue is not a high priority issue for me. If someone else is strongly motivated to resolve this issue, a pull request or patch is very welcome.

Hi @enzotib, Sorry, it took so long for you to get an answer when you reported this issue earlier at #29. I maintain this project in my spare time and there are some months when I am too busy to devote any time to this project. I do respond to messages when I can, based on how much spare time I have and how I want to spend that spare time. I know this is not ideal for someone stuck due to an unclear error message. I'd love for their to be more volunteers who could help out with the issues and questions being submitted. However, the fact is that this is a small project with not many volunteers, so the time to respond to new issues and questions can be rather long.