Skip to content

Commit

Permalink
fix(schema): Strip reference values (#36)
Browse files Browse the repository at this point in the history
* fix(schema): Strip reference values

* docs: Update changelog
  • Loading branch information
SilverRainZ authored Aug 10, 2024
1 parent d767012 commit c505e78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ Change Log
Version 2.x
===========

..
.. version:: 2.5
- Add new Sphinx Domain classifier (:pull:`27`)
- Strip rST markups in index description (:pull:`32`)
- refactor: Combing and document srcdir, outdir, reldir
- Fix referenceable field with multiple lines form (:issue:`34`)

.. version:: 2.4.0
:date: 2023-08-26

Expand Down
3 changes: 1 addition & 2 deletions src/sphinxnotes/any/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def _as_lines(self, rawval:str) -> list[str]:
return rawval.split('\n')



def value_of(self, rawval:str|None) -> None|str|list[str]:
if rawval is None:
assert not self.required
Expand Down Expand Up @@ -283,7 +282,7 @@ def references_of(self, obj:Object) -> set[tuple[str,str]]:
elif isinstance(val, str):
refs.append((name, val))
elif isinstance(val, list):
refs += [(name, x) for x in val]
refs += [(name, x.strip()) for x in val if x.strip() != '']
return set(refs)


Expand Down

0 comments on commit c505e78

Please sign in to comment.