Make `mention` write empty `accessLevel`

Issue #31 wontfix
Chris Fuller created an issue

As with issue 29, this is a case where the editor does something a bit silly and we need to mimic it for now so we can get through the consistency correlation process.

We have always documented that the mention node has an optional accessLevel attribute whose valid values are NONE, SITE, APPLICATION, or CONTAINER. However, the schema has never enforced this, and the editor frequently sets it to an empty string, as in:

{
  "type": "mention",
  "attrs": {
    "id" : "d12f496b-14fa-4221-9bae-e256cc53df3c",
    "accessLevel": ""
  }
}

I think we can treat the empty string as distinct from null and start including it when it has been set as such.

Edit: It already does this. That means this is being introduced at some point (the prestore?) and that isn’t being done by the library. I’ll discuss options with Craig, because I think this may be a case where it’s better to have the prestore postprocess the nodes than mess with it in the library itself.

Comments (2)

  1. Chris Fuller reporter

    I don't think we want to do this after all. Either returning the ADF that goes into the prestore or postprocessing mentions in the prestore code seems like a better approach. I'll let Craig decide which of those paths causes the least pain.

  2. Log in to comment