Skip to content

Commit

Permalink
Add default href to match Sanity studio behavior (href is omitted if …
Browse files Browse the repository at this point in the history
…given as empty string)
  • Loading branch information
sondrelg committed Apr 19, 2021
1 parent b7fc2b8 commit 13191cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sanity_html/marker_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def render_prefix(cls: Type[MarkerDefinition], span: Span, marker: str, context:
marker_defintion = next((md for md in context.markDefs if md['_key'] == marker), None)
if not marker_defintion:
raise ValueError(f'Marker definition for key: {marker} not found in parent block context')
href = marker_defintion['href']
href = marker_defintion.get('href', '')
return f'<a href="{href}">'


Expand Down

0 comments on commit 13191cd

Please sign in to comment.