Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin doesn't resolve keyref/conref in DITA to properly analyze sentence. #10

Open
shudson310 opened this issue Oct 27, 2020 · 1 comment

Comments

@shudson310
Copy link

The plugin fails to resolve keyref/conkeyref/conref properly, which results in false positives. For example:

<p>All decisions in connection with the implementation of this application are at the sole
        decision of the Employer utilizing this application. Employers agree that use of the
        application is not a representation by <ph keyref="company-no-reg-tm"/> regarding the
        application’s compliance with any law or regulation and any suggested language provided out
        of the box with the application does not constitute legal advice by <ph
          keyref="company-no-reg-tm"/>. </p>

and:

<p><ph keyref="company-no-reg-tm"/> shall not be responsible for any
        implementation or configuration costs associated with use of the application unless
        separately purchased.</p>
@raducoravu
Copy link
Contributor

There are two particular cases, the conrefs/conkeyrefs and the keyrefs.
The text content of the conrefs/conkeyrefs exists in the internal Author content so it is accessible. It would somehow need to be treated transparently along with the other text in the paragraph. Looking at how the Java code for navigating the Author content is implemented:
https://github.com/danielnaber/oxygen-languagetool-plugin/blob/master/src/main/java/org/languagetool/oxygen/AuthorModeTextCollector.java
the conreffed content should be taken into account.

The keyreffed content is harder because it is not part of the Author internal model, it's like static text in a CSS. We have some API which could be called to retrieve the text content for a keyref:
https://github.com/oxygenxml/javascript-sample-operations/blob/master/replace-conrefs-keyrefs/replace-conrefs-keyrefs.js
but it's DITA specific and the add-on does not have DITA-XML specific code it it, it's designed to work on any generic XML document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants