gregorias / anki-code-highlighter

Anki plugin for code syntax highlighting.
GNU Affero General Public License v3.0
54 stars 3 forks source link

MarkupResemblesLocatorWarning #37

Closed gregorias closed 1 year ago

gregorias commented 1 year ago

Repro

Try to highlight the code in

void main() {
  vector v;
  const vector cv;
  f(v);            // 1
  f(cv);           // 2
  f(std::move(v)); // 3
}

I got:

An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
Anki 2.1.56 (07fd88dd) Python 3.9.15 Qt 6.3.2 PyQt 6.3.1
Platform: macOS-13.2-arm64-arm-64bit
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2023-02-07 10:07:00

bs4:435: MarkupResemblesLocatorWarning: The input looks more like a filename than markup. You may want to open this file and pass the filehandle into Beautiful Soup.

Approach

I probably need to handle BS' warnings.