html_entities was removed by 5792d4aebd
because libxml2 can already convert all html entities without requiring
the user to manually type them in. Mention of this file was previously
removed from the man pages, but not from the README.
Review the code for proper use of localized strings. Fix display code to
always output them as utf8. Recreate the localization template with the
strings currently in use. Convert all existing .po files to utf8. Run
msgmerge on all .po files to update strings to match the new template.
Due to my lack of experience in using gettext and subsequent avoidance
of messing with it, the localization data has not been updated in quite
some time and most strings have become obsolete. This unfortunately has
resulted in wasted effort from some translators, most recently @J0hsHH
and @Strahinja, to whom I can only offer an apology and an invitation to
review their translations.
Restore linking to -lintl, which contains gettext on non-linux
platforms. Was removed together with -liconv by commit
63f0d70806. iconv is no longer needed, but
intl still is. Fixes#68.
Write a new, simpler and more efficient, text rewrapper. Remove
generation of the linked list of lines for display and instead
display lines directly from the buffer.
Stop using iconvert and remove it. RSS text must always be formatted in
UTF8 and other locale encodings are not supported. With no encoding
conversion needed, libiconv is also no longer used, so stop linking it.
- Remove docs/CHANGES; see git release tag description.
- Remove docs/CREDITS; see git history.
- Deprecate filters. Filters used to be necessary for getting
https or Atom feeds. Since both of these were very common, everybody
had to use filters. Now snownews reads https and Atom natively
and filters just aren't needed any more for most people. So keep
supporting them, but stop mentioning them favorably in the docs.
- Remove the bugzilla example script. Having contributed scripts in the
main repository is a bad idea because I can't test them and thus
have no idea whether they work. They were never even installed by
default, making discoverability a problem.
Stop reading or creating the html_entities config file. libxml
htmlEntityLookup already knows about all the entities, so there is no
reason to make the user type them in manually.
Simplify UIDejunk to strip tags in-place instead of reallocating the
output char-by-char. Remove hardcoded entity matching, use only
htmlEntityLookup from libxml, which already knows about them. Always
output UTF8 instead of the terminal locale when replacing entities.
Should always use utf8_length when checking line length against screen
width, but always use strlen when checking the size of the buffer. Using
strlen to check against width resulted not cutting the loop.
SIGINT, SIGQUIT, and SIGTERM indicate that the user or something else is
trying to terminate snownews, rather than an internal error, so a clean
shutdown is more appropriate than an error message. Closes#63
It is not uncommon to have feeds with an ampersand in the URL or a
quotation mark in the title, which currently make snownews use a
malformed URL or not read the feed entry at all.
This probably also affects categories and filters, though because they
are user-defined, one can just not use special XML characters in them.
Some incompetently written HTML descriptions contain CDATA tags,
sometimes in a horribly arranged soup that seems designed to break out
of a CDATA, which is what RSS wraps it with. The parser chokes on it, of
course, but once stripped, the item can be saved with only a few visual
artifacts of comments and tag pieces.
Previously, the atom parsing function would fill in an items link string
with the `href` attribute of the last `<link>` that it found. However,
because the spec (https://validator.w3.org/feed/docs/atom.html#link)
allows an item to have multiple `<link>` tags, with different meanings,
identified by the `rel` attribute, this can lead to the wrong url being
used.
The one we want, the link to the post content, should have the attribute
`rel="alternate"`, or, as this is the default, no `rel` attribute at
all. The atom parsing function now checks for this, and will not set an
items link string unless this is the case.
Thanks to @Uks2 for the fix.
Previously `_feed_list_changed` wouldn't be set to true when the '(New
Headlines)' feed was added or when any smart feed was removed. This
lead to unintuitive behaviour where these changed wouldn't be saved if
they were the only changed made, but would be saved if other feeds were
changed as well. Thanks to @Uks2 for the fix.
Adding a new pointer to the doubly-linked list _feed_list is not a
one-liner and that code was implemented in different ways in three
places. Make all of them call AddFeedToList instead to add a feed.
Display feed title in the titlebar instead of on its own line.
Display item link in status bar in feed list and in item view.
Move modified date string to titlebar.
Commit c42dc99a55 went a bit overboard on
quoting. Remove quoting of non-path variables, since they are not
allowed to contain spaces anyway. escpath arguments no longer need to be
quoted because it now operates on all arguments.
Changes by @aabacchus, from running shellcheck.
Fix double-negative conditionals. Use double quotes around substitution
vars to prevent globbing and word splitting. Replace backquote calls
with $() for consistency. Fix syntax error for expr that can take
no arguments.
ncurses can be built without widechar support, indicated by not
setting NCURSES_WIDECHAR. In this case any non-english chars will be
substituted with a '?'. Closes#59
libXML made a strange decision to use unsigned char pointers throughout
the API, even though all the strings anyone wants to give it are char.
An unreadable sea of casts results. So this adds wrapping calls to work
with char* and thus drastically shrinks and clarifies the parsing code.
A newly added feed has no custom title, but it will always have a title
downloaded with the feed XML. Save this title into urls.opml. Otherwise
the newly added feed will not be loaded on the next snownews launch.
The old format consisted of |-separated lines, one per feed. OPML is the
usual standard for RSS feed lists, and snownews included the opml2snow
utility to convert to and from it. This commit converts urls format to
native OPML, removing the need for the utility. The file is also renamed
from urls to urls.opml.
snownews kept configuration in ~/.snownews and the feed cache in
~/.snownews/cache. This commit moves configuration to ~/.config/snownews
and the cache to ~/.local/share/snownews, conforming to the XDG basedir
specification. snownews will migrate old settings to the new location.