Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

Better diff support for Grid Layouts with CDATA and preserved line feeds for some PreValues #9

Closed
davidtwamley opened this issue Jan 30, 2017 · 1 comment

Comments

@davidtwamley
Copy link

We've encountered an issue several times where the json for a grid layout is modified by multiple developers (even simple changes like which grid editors are allowed) on their feature branches and then merging them is difficult because the json is collapsed down to a single line. In these cases we've resorted to extracting out the raw json from both and putting them in beyond compare. It would be very nice though if instead, these values were wrapped in a CDATA and line feeds were preserved.

Here is an abbreviated example of what we see:

<DataType Name="Grid - Text Page" Key="" Id="Umbraco.Grid" DatabaseType="Ntext">
  <PreValues>
    <PreValue Id="1134" Value="{&#xD;&#xA;  &quot;styles&quot;: [&#xD;&#xA;    {&#xD;&#xA;      &quot;label&quot;: &quot;Background Image&quot;,&#xD;&#xA;      &quot;description&quot;
    ...58,000+ chars..." Alias="items" />
  </PreValues>
</DataType>

We are using LeBlender but I don't think that matters. I believe storing json in Ntext is becoming more popular too so maybe a generic fix would be best. Some suggestions:

  • Always use CDATA for PreValue so the line feeds are preserved
  • Detect when CDATA for PreValue would be better, maybe any of these:
    • First char is {
    • Value contains \n
    • Character length > 300

Thanks!

@davidtwamley
Copy link
Author

Just realized I filed this under the old repo. Moved it to here:

KevinJump/uSync#128

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

No branches or pull requests

1 participant