Content parsed with InlineCodeFinder should be encoded on merge...

Issue #1161 resolved
jhargrave-straker created an issue

InlineCodeFinder can’t know if the content it is processing is a subformat (for example HTML) - but we should minimally encode the content for the parent format. Example TAML with HTML tags:

input:

<a href=\"/users/unlock/new\">request another one</a>

incorrect output:

<a href="/users/unlock/new">request another one</a>

The YAML filter decodes the \” - but does not restore them on merge. This may happen with other filters that use InlineCodeFinder. We should come up with a consistent way to handle this. Should we also handle subformats?

Comments (6)

  1. jhargrave-straker reporter

    Ideally Code data (but not ouerData?) should be encoded with GenericSkeletonWriter, but this functionality is turned off because each filter seems to do its own thing. I’d like to standardize this, but it would mean changes to several filters. POssible I may just hack a fix for YamlFilter and leave this code commented out.

    if ( !code.hasReference() ) {
                /* if no outerdata (container format lime xliff, tmx) run the encoder
                FIXME: outerdata and data she ne handled independently using different encoders!
                FIXME: getOuterData should *not* magically return data
                FIXME: enable this code when all filters properly handle encoding
                all encoding details should happen in the encoders and IFilterWriter/ISkeletonWriter
                see IEncoder JavaDoc
                if (!code.hasOuterData()) {
                    codeTmp = encoderManager.encode(codeTmp, EncoderContext.INLINE);
                }*/
                return codeTmp;
            }
    

  2. jhargrave-straker reporter

    I decided to simply fix the YamlFilter - but this should be on the cleanup TODO list at some point.

  3. jhargrave-straker reporter

    Merged in Issue_1161 (pull request #641)

    fix Issue #1161

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • fix Issue #1161

    Approved-by: YvesS

    → <<cset e37a5973484d>>

  4. jhargrave-straker reporter

    Merged in Issue_1161 (pull request #641)

    fix Issue #1161

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • Merge branch 'dev' of bitbucket.org:okapiframework/okapi into dev

    • fix Issue #1161

    Approved-by: YvesS

    → <<cset e37a5973484d>>

  5. Log in to comment