* Pass JapaneseUtil instance to StructuredContentGenerator
* Move body of createStructuredContent to an internal function
* Create _createStructuredContentGenericElement
* Wrap structured content in a <span>
* Change _createStructuredContent to _appendStructuredContent
* Add public appendStructuredContent function
* Add missing return
* Remove unused _createDocumentFragment
* Automatically assign lang=ja for content with Japanese characters
without an explicit language
* Add test
* Add support for structured content lists and `list-style-type` style
A full list of supported style types is documented here:
https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type
There's nothing in this code preventing a term bank from assigning,
for example, a `list-style-type` style to a `div` element, but it
doesn't seem like browsers will complain about things like that.
* Add support for `lang` attribute in structured content
Support added for the following node types:
"ruby", "rt", "rp", "table", "thead", "tbody", "tfoot", "tr", "td",
"th", "span", "div", "ol", "ul", "li", "a"
I couldn't get it to work for the alt-hover text on "img" tags.
Tests are included in the file
"test/data/dictionaries/valid-dictionary/term_bank_1.json"
* Add styles for structured content lists
* Add override rules for new structured-content list styles
see: https://github.com/FooSoft/yomichan/pull/2129
Co-authored-by: stephenmk <stephenmk@users.noreply.github.com>
* Update CSS to JSON converter to generalize the remove-property comment
* Fix navigation not being updated when _clearContent is run
* Add structured content schema for link tags
* Add test links
* Add external-link icon
* Pass Display instance to DisplayContentManager
* Update structured content generation
* Update link styles
* Update DictionaryDatabase._findMultiBulk's createResult callback signature
* Simplify _splitField use
* Update sequence
* Expose new fields 'matchType' and 'matchSource' as part of term data
* Expose matchType and matchSource as part of TermSource
* Update sourceTermExactMatchCount calculation
* Update test data
* Expose matchType and matchSource info in HTML attributes
* Add primaryMatchTypes attribute
* Restore support for string frequency values
* Add support for {value, displayValue} frequencies
* Update test data
* Improve number parsing of string frequencies
* Improve reading detection
* Expose a displayValue property for frequency information
* Update docs
* Expose displayValue to Anki note data
* Fix translator
* Update display generation
* Update test data
* Update counts
* Add support for structured-content data attributes
* Assign dataset properties
* Don't remove data-sc attributes
* Use helper functions
* Update test data
* Update anki pronunciation templates
* Expose nasalPositions/devoicePositions
* Update templates to support nasal/devoice positions
* Update test data
* Simplify svg and container styles
* Rename pitch-accent-details to pitch-accent-graph-container
* Rename pitch-accent-graph* to pronunciation-graph*
* Remove unused template
* Omit quotes
* Rename pitch-accent-character to pronunciation-mora
* Simplify names
* Replace pronunciation-mora-inner with pronunciation-character
* Improve grouping of nasal characters
* Simplify character replacement
* Replace pseudo-elements with real elements
* Use an element rather than a fragment
* Rename functions
* Add wrapper
* Rename pitch-accent-characters to pronunciation-text-container
* Update test data
* Update downstep notation generation
* Rename pitch-accent-position to pronunciation-downstep-notation-container
* Space
* Wrap pronunciations in a container node
* Update preview
* Embed pitch accent styles directly
* Update schema to support information about nasal and devoiced mora
* Expose nasalPositions and devoicePositions in dictionary entry data
* Expose nasalPositions, devoicePositions in grouped pitch info
* Update display generator
* Update test dictionary data
* Update test data
* Add support for textFurigana media
* Add readingMode parameter
* Implement readingMode
* Add {sentence-furigana} marker
* Fallback to sentence if furigana isn't available
* Update test data
* Add support for injecting the text selection into Anki cards
* Add selection-text
* Upgrade to add {selection-text}
* Update descriptions
* Update test data
* Add TemplateRendererMediaProvider to abstract media-related functionality
* Update representation of injected media
* Update templates
* Update upgrade file
* Update tests
* Update test data
* Force media to be an object
* Update test data
* Update how glossary text is formatted
* Update structured content and image generation
* Pass root data to _createStructuredContentGenerator
* Implement media URLs
* Update documentation
* Update options util
* Apply styles to content
* Improve HTML normalization
* Update DatabaseVM.fetch function
* Update test
* Update test data
* Add {dictionaryIndex, dictionaryPriority} to definitions
* Add score to definitions
* Add id to definition
* Use definition id instead of ids array
* Remove ids array
* Update docs
* Update test data
* Add support for imageRendering
* Make crisp-edges appearance on Firefox more similar to Chrome
* Refactor
* Add background option
* Move data-image-rendering attribute
* Restructure
* Organize
* Add support for appearance
* Update test dictionary
* Update tests
* Allow unsequenced definitions to be added to multiple groups
* Update translator data to store multiple IDs
* Update Anki note data
* Update test data
* Update docs
* Update test data for valid-dictionary1
* Use valid-dictionary1 instead of valid-dictionary2
* Update test data
* Remove test of valid-dictionary2
* Remove valid-dictionary2 data
* Rename _addUniqueStrings to _addUniqueSimple
* Update definition merging to not depend the sequence number
* Improve naming
* Update AnkiNoteDataCreator
* Update docs
* Remove fields that no longer exist
* Update test data
* Ensure negative sequence is always -1
* Expose sequence on definition objects
* Update how sequence is exposed for definitions
* Update test data
* Update TS docs
* Improve sequence for merged entries and add sequenceDictionary
* Update docs
* Expose sequence in definitions
* Expose sequence in root definition
* Update test data
* Add part of speech info to headwords
* Expose parts of speech to Anki template rendering
* Expose parts of speech
* Update pitch accent categories
* Update docs
* Add part-of-speech
* Update options and tests
* Update markers
* Update test data
* Update test data
* Move translator.js
* Create new version of Translator
* Update Backend
* Update DictionaryDataUtil
* Update DisplayGenerator
* Create AnkiNoteDataCreator
* Replace AnkiNoteData with AnkiNoteDataCreator
* Update tests
* Remove AnkiNoteData
* Update test data
* Remove translator-old.js
* Add TypeScript interface definitions for the new translator data format
* Remove redundant language assignment
* Segment furigana from DisplayGenerator
* Remove furiganaSegments from translator data
* Add backwards compatibility for furiganaSegments
* Update tests