Skip to content

Commit

Permalink
Merge pull request #198 from vrk-kpa/escape_structured_data
Browse files Browse the repository at this point in the history
Use simplejson HTML encoder for structured data
  • Loading branch information
amercader authored Jun 22, 2021
2 parents c285382 + 5804a19 commit 3d86671
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckanext/dcat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from builtins import str
import logging
import uuid
import json
import simplejson as json
import re
import operator

Expand Down Expand Up @@ -133,7 +133,7 @@ def structured_data(dataset_id, profiles=None, _format='jsonld'):
try:
json_data = json.loads(data)
return json.dumps(json_data, sort_keys=True,
indent=4, separators=(',', ': '))
indent=4, separators=(',', ': '), cls=json.JSONEncoderForHTML)
except ValueError:
# result was not JSON, return anyway
return data
Expand Down

0 comments on commit 3d86671

Please sign in to comment.