Commit graph

24 commits

Author SHA1 Message Date
Andreas Reis
81d6d21ae3 cleanup / renames
・ soundRegexps →  sound_regexps

・ htmlRegexps →  html_media_regexps

・ HTML_TAGS →  HTML_MEDIA_TAGS

・ escapeImages →  escape_media_filenames + alias

・ strip_html_preserving_image_filenames →  strip_html_preserving_media_filenames
2020-11-10 14:53:04 +01:00
Andreas Reis
c77ac81e9d Add audio & object tags to media check
Makes the media check recognize files in <audio> and <object> tags as used.

They've been observed/supported by the WebView (checked: Anki, AnkiDroid) since just about forever already and are extremely useful if one knows a thing about web dev.
2020-10-25 13:09:57 +01:00
Damien Elmes
cce0ee2b03 handle quoted html chars in media check
https://forums.ankiweb.net/t/unable-to-play-longer-audio-on-cards/1313/30
2020-09-04 09:36:38 +10:00
Damien Elmes
55ae49e251 fix nonbreaking spaces breaking media
https://forums.ankiweb.net/t/unable-to-play-longer-audio-on-cards/1313
2020-08-30 11:23:12 +10:00
Damien Elmes
cb821a9e3c fix globs not working in bulk tag add/remove 2020-08-17 18:14:00 +10:00
Damien Elmes
475478cec5 split note types into separate tables
- store the config in protobuf instead of json
- still loading+saving in bulk for now
- code using the schema11 structs needs to be migrated
2020-05-12 21:13:33 +10:00
Damien Elmes
8a423e05fe ignore empty sound tags
https://github.com/ankitects/anki/pull/612
2020-05-12 20:53:50 +10:00
Damien Elmes
f2876cbd42 preserve entities when stripping HTML for MathJax
https://anki.tenderapp.com/discussions/ankidesktop/40987-how-to-render-angled-brackets
2020-04-30 11:17:38 +10:00
Damien Elmes
cf50821d3b add search that ignores combining chars
On a test of a ~40k card collection, the 'ignore accents' add-on
takes about 1150ms, and this code takes about 70ms.
2020-03-21 15:15:59 +10:00
Damien Elmes
0a6c5dd240 don't require wildcard for unicode case folding in search 2020-03-21 12:44:56 +10:00
Damien Elmes
1b2ebfcf6f deck searching
A bit more complicated than it needs to be, as we don't have the
full deck manager infrastructure yet.
2020-03-20 21:15:23 +10:00
Damien Elmes
42781a696f remove some unused imports 2020-02-29 15:21:11 +10:00
Damien Elmes
8f34c720b8 remove redundant test_ prefix 2020-02-17 08:40:17 +10:00
Damien Elmes
d557312f73 include LaTeX png/svg files when checking for unused media 2020-02-17 08:40:17 +10:00
Damien Elmes
92b76a5ba7 gather field references in Rust; media check now mostly complete 2020-02-17 08:40:17 +10:00
Damien Elmes
2d859df88f nfc helper 2020-02-17 08:40:17 +10:00
Damien Elmes
86a580d820 reuse reveal_cloze_text() for LaTeX cloze expansion 2020-01-28 07:40:44 +10:00
Damien Elmes
d598ce45fe move cloze-related code into a separate file 2020-01-27 20:41:23 +10:00
Damien Elmes
47bcb3845c support speed control in tts tags 2020-01-26 14:31:07 +10:00
Damien Elmes
46c6a7f7e4 extract and flag AV tags as part of the render process
We can now show replay buttons for the audio contained in {{FrontSide}}
without having to play it again when the answer is shown.

The template code now always defers FrontSide rendering, as it wasn't
a big saving, and meant the logic had to be implemented twice.
2020-01-24 11:06:11 +10:00
Damien Elmes
2ee8902bd9 added flag_av_tags() for replay button support 2020-01-21 14:44:27 +10:00
Damien Elmes
b0d2958721 add rank handling to TTS; parse TTS args in get_av_tags() 2020-01-21 12:41:37 +10:00
Damien Elmes
548ed31ef7 add a simple TTS field filter
This simply wraps the field in extra text that the frontend will
deal with. Also added some helpers for extracting and stripping
audio and TTS tags from the rendered text.
2020-01-20 19:16:24 +10:00
Damien Elmes
ab841d9ebe add some text helpers 2020-01-10 21:01:23 +10:00