The Webfeed Flutter package for Appeto SDK.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

31 行
668 B

  1. import 'package:xml/xml.dart';
  2. final _imagesRegExp = RegExp(
  3. "<img\\s.*?src=(?:'|\")([^'\">]+)(?:'|\")",
  4. multiLine: true,
  5. caseSensitive: false,
  6. );
  7. /// For RSS Content Module:
  8. ///
  9. /// - `xmlns:content="http://purl.org/rss/1.0/modules/content/"`
  10. ///
  11. class RssContent {
  12. String value;
  13. Iterable<String?> images;
  14. RssContent(this.value, this.images);
  15. static parse(XmlElement? element) {
  16. if(element == null) {
  17. return null;
  18. }
  19. final dynamic? content = element.text;
  20. final images = <String?>[];
  21. _imagesRegExp.allMatches(content).forEach((match) {
  22. images.add(match.group(1));
  23. });
  24. return RssContent(content, images);
  25. }
  26. }