Open lucaju opened 4 years ago
8c471e28618154146033bcbbc4f82d4d567e002a
confirmed on dev-cwrc-writer, but also adding <?xml-stylesheet type="text/css" href="undefined"?>
to the document if no css defined; see https://dev-cwrc-writer.cwrc.ca/?githubPath=issues%2FCWRC-WriterBase%2F215&githubRepo=ilovan%2FGit-Writer-tests;
is it necessary, @ajmacdonald ? It may be related to https://github.com/cwrc/CWRC-WriterBase/issues/216
So if no CSS is specified in the loaded document, then none should be added when it's saved. What about during the editing process?
I am a bit torn. On one hand, it makes sense not to "deceive" the user by applying processing instructions that are not there, on the other I can see the benefits for readability of temporarily applying a css while the document is being edited.
Could we do what we do with the schema? [If the schema declared can't be read, then we ask if it's OK for CWRC_Writer to try to guess a schema and then apply TEI by default for all the docs that have TEI as the root element.
We could do the same with the CSS
Document load process could go something like this:
wdyt, @SusanBrown
I agree--sounds like a good way to go.
Expected Behaviour
The original schema reference (URL) for the document must be preserved during the saving process. Unless the user actively changes the schema on the setting panel.
Current Behaviour
The schema reference (URL) is replaced in the document for the one CRWC-Writer is able to load during the XML2CWRC process. Image one shows the original reference on the file before passing through CRWC. Image two shows that not only the reference changed, but it added the proxy URL as well.
This bug was introduced by the recent changes in the way CWRC-Writer loads schemas.
Possible Solution
Store the original schema URL while editing a document. Restore it to the file when saving. Change the stored URL if the user selects a different schema on the settings panel.
Steps to Reproduce (for bugs)
Your Environment
URL: https://dev-cwrc-writer.cwrc.ca/
Browser Name: Chrome (not relevant)
Operating System: macOS (not relevant)
Attachments: