/* This file is part of the syndication library SPDX-FileCopyrightText: 2005 Frank Osterfeld SPDX-License-Identifier: LGPL-2.0-or-later */ #include "tools.h" #include #include #include #include #include namespace Syndication { namespace RSS2 { //@cond PRIVATE QString extractContent(const ElementWrapper &wrapper) { if (wrapper.isNull()) { return QString(); } QList list = wrapper.elementsByTagNameNS(contentNameSpace(), QStringLiteral("encoded")); if (!list.isEmpty()) { return list.first().text().trimmed(); } list = wrapper.elementsByTagNameNS(xhtmlNamespace(), QStringLiteral("body")); if (!list.isEmpty()) { return ElementWrapper::childNodesAsXML(list.first()).trimmed(); } list = wrapper.elementsByTagNameNS(xhtmlNamespace(), QStringLiteral("div")); if (!list.isEmpty()) { return ElementWrapper::childNodesAsXML(list.first()).trimmed(); } return QString(); } //@endcond } // namespace RSS2 } // namespace Syndication