File tree Expand file tree Collapse file tree 4 files changed +15
-4
lines changed
Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,14 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8- ## [ Unreleased ]
8+ ## [ released ]
99
1010## [ 3.0.7.pre] - 2024-10-06
1111
1212### Added
1313- Initial release of ` wikidotrb ` , a Ruby library inspired by ` wikidot.py ` .
14+
15+ ## [ 3.0.7.pre.1] - 2024-10-08
16+
17+ ### Changed
18+ - Improved ` UserParser.parse ` method to convert non-` Nokogiri::XML::Element ` elements properly before processing.
Original file line number Diff line number Diff line change @@ -12,7 +12,13 @@ class UserParser
1212 # @param elem [Nokogiri::XML::Element] パース対象の要素(printuserクラスがついた要素)
1313 # @return [AbstractUser] パースされて得られたユーザーオブジェクト
1414 def self . parse ( client , elem )
15- return nil if elem . nil? || !elem . is_a? ( Nokogiri ::XML ::Element )
15+ if elem . nil?
16+ return nil
17+ elsif !elem . is_a? ( Nokogiri ::XML ::Element )
18+ # 文字列であることを仮定し、Nokogiriで変換する
19+ parsed_doc = Nokogiri ::HTML . fragment ( elem . to_s )
20+ elem = parsed_doc . children . first
21+ end
1622
1723 if elem [ "class" ] &.include? ( "deleted" )
1824 # "deleted"クラスがある場合はDeletedUser
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module Wikidotrb
4- VERSION = "0 .0.1-dev1 "
4+ VERSION = "3 .0.7.pre.1 "
55end
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ require_relative "lib/wikidotrb/version"
44
55Gem ::Specification . new do |spec |
66 spec . name = "wikidotrb"
7- spec . version = "3.0.7.pre"
7+ spec . version = "3.0.7.pre.1 "
88 spec . authors = [ "r74tech" ]
99 spec . email = [ "[email protected] " ] 1010
You can’t perform that action at this time.
0 commit comments