Skip to content

Commit 3ed5ad1

Browse files
committed
fixes #3
1 parent 73dcafe commit 3ed5ad1

File tree

5 files changed

+52
-3
lines changed

5 files changed

+52
-3
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Build"
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
strategy:
10+
matrix:
11+
os:
12+
- windows-latest
13+
# - macos-latest
14+
- ubuntu-latest
15+
nimversion:
16+
- stable
17+
- devel
18+
name: ${{ matrix.os }} - ${{ matrix.nimversion }}
19+
runs-on: ${{ matrix.os }}
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: iffy/[email protected]
25+
with:
26+
version: ${{ matrix.nimversion }}
27+
- run: nim --version
28+
- name: Refresh packages + install dependencies
29+
run: |
30+
nimble refresh
31+
nimble install -d
32+
- name: Run all tests
33+
run: nimble test

src/xml.nim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import strformat, strutils, strtabs
88
const NameIdentChars = IdentChars + {':', '-', '.'}
99

1010
type
11-
XmlParserException* = object of Exception
11+
XmlParserException* = object of CatchableError
1212

1313
TokenKind* = enum
1414
TAG_BEGIN
@@ -74,7 +74,6 @@ iterator tokens*(input: string): XmlToken {.inline.} =
7474
skip_until('>')
7575
# print out prologue
7676
#echo input[0..pos]
77-
inc(pos)
7877
of '!':
7978
inc(pos)
8079
if input[pos..pos+6] == "[CDATA[":
File renamed without changes.

tests/test_issue3.nim

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import xml, xml/selector
2+
3+
let content1 = """<?xml version="1.0" encoding="UTF-8"?><profile>
4+
<steamID64>76561198859045421</steamID64>
5+
</profile>"""
6+
7+
let content2 = """<?xml version="1.0" encoding="UTF-8"?> <profile>
8+
<steamID64>76561198859045421</steamID64>
9+
</profile>"""
10+
11+
var
12+
d1 = q(content1)
13+
d2 = q(content2)
14+
15+
echo d1.select("steamID64")
16+
echo d2.select("steamID64")
17+
assert d1.select("steamID64")[0].text == d2.select("steamID64")[0].text

xml.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Package
22

3-
version = "0.1.3"
3+
version = "0.1.4"
44
author = "Huy Doan"
55
description = "Pure Nim XML parser"
66
license = "MIT"

0 commit comments

Comments
 (0)