fix: normalizing spaces for authors/dek/title (#31)
* fix: normalizing spaces for authors/dek/titlepull/32/head^2
parent
9a23b24a89
commit
cfe7f34be4
@ -1,7 +1,10 @@
|
||||
import { normalizeSpaces } from 'utils/text';
|
||||
import { CLEAN_AUTHOR_RE } from './constants';
|
||||
|
||||
// Take an author string (like 'By David Smith ') and clean it to
|
||||
// just the name(s): 'David Smith'.
|
||||
export default function cleanAuthor(author) {
|
||||
return author.replace(CLEAN_AUTHOR_RE, '$2').trim();
|
||||
return normalizeSpaces(
|
||||
author.replace(CLEAN_AUTHOR_RE, '$2').trim()
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue