mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge c62877622c into 9ebe06156c
This commit is contained in:
commit
f56a0dac3b
1 changed files with 3 additions and 1 deletions
|
|
@ -426,7 +426,9 @@ def feed2fields(file):
|
||||||
|
|
||||||
def build_header(title, date, author, categories, tags, slug):
|
def build_header(title, date, author, categories, tags, slug):
|
||||||
"""Build a header from a list of fields"""
|
"""Build a header from a list of fields"""
|
||||||
header = '%s\n%s\n' % (title, '#' * len(title))
|
import unicodedata
|
||||||
|
title_width = sum([(2 if unicodedata.east_asian_width(c) in u"WFA" else 1) for c in title])
|
||||||
|
header = '%s\n%s\n' % (title, '#' * title_width)
|
||||||
if date:
|
if date:
|
||||||
header += ':date: %s\n' % date
|
header += ':date: %s\n' % date
|
||||||
if author:
|
if author:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue