Fix structured text translation for soft line breaks, links, and inline blocks - #79
Open
thales-goncalves wants to merge 2 commits into
Open
thales-goncalves wants to merge 2 commits into
thales-goncalves wants to merge 2 commits into
Conversation
…tion Spans with \n were misclassified as markdown, causing them to be skipped. Fixes voorhoede#77
✅ Deploy Preview for datocms-plugin-translate-fields ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…lock) Fixes voorhoede#73 - Broaden isStructuredTextText to recognize any node with type + children - Extend isStructuredTextBlock to handle inlineBlock nodes - Add item key to ID protection list
Member
|
🌊 Thanks you for your contribution! I like the concept of this change, but I briefly discussed this with @velomovies and we are afraid this might introduce other bugs regarding field detection. What do you think of this? Perhaps you'd rather use their plugin, I'm curious if you prefer our plugin for a specific reason. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\n(soft line breaks from Shift+Enter) were silently skipped during translationRoot causes and fixes
Soft line breaks (#77):
getValueTypemisclassified text containing\nas markdown (matchedmarkdownparagraphregex), andgetStructuredTextTranslationonly translatedPathType.textspans. Fix: checkpath.key === 'text'instead ofpath.type === PathType.text.Node type handling (#73):
isStructuredTextTextused rigid key-count checks that only matched nodes with exact key combinations (type+children, optionallylevel/style). Nodes likelink(hasurl),itemLink(hasitem), andinlineBlockwere not recognized. Fix:isStructuredTextTextto recognize any node withtype+children(excluding blocks, inline items, and code)isStructuredTextBlockto also handleinlineBlocknodesitemkey to the ID protection list ingetValueTypeNode types now handled
softBreak(\nin text)linkitemLinkinlineBlockblockinlineItemblockTest plan