bitmark-standard / bitmark-grammar

7 stars 0 forks source link

‘bullet’ is extracted from the ‘body’ and there is no way to re-insert #5

Open six5536 opened 1 year ago

six5536 commented 1 year ago

Describe the bug Not sure is this is not legacy, but I am raising the bug in any case.

To Reproduce Parse the following bitmark to produce JSON output:

[.rating]
[@id:186276]
===
Die in der letzten QualiCarte festgehaltenen Massnahmen sind wirksam. Die gesetzten Ziele wurden erreicht.
[• --]
[• -]
[• +]
[• ++]
===

The following JSON is produced:

 {
   "bitmark": "[.rating]\n[@id:186276]\n===\nDie in der letzten QualiCarte festgehaltenen Massnahmen sind wirksam. Die gesetzten Ziele wurden erreicht.\n[• --]\n[• -]\n[• +]\n[• ++]\n===",
   "bit": {
     "type": "rating",
     "format": "bitmark--",
     "body": "===\nDie in der letzten QualiCarte festgehaltenen Massnahmen sind wirksam. Die gesetzten Ziele wurden erreicht.\n\n\n\n\n===",
     "item": "",
     "hint": "",
     "isExample": false,
     "example": "",
     "id": [
       "186276"
     ],
     "bullet": [
       "--",
       "-",
       "+",
       "++"
     ]
   }
 }

Expected behavior Unsure what the correct behaviour would be, but this cannot be correct, as it is not possible to reverse the JSON back to bitmark. Some information has been lost.

versions 1.0.38