We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b96735 commit 75aec69Copy full SHA for 75aec69
src/lib/xpath.pl
@@ -642,11 +642,22 @@
642
no_leading_whitespace(Cs0, Cs1),
643
reverse(Cs1, Cs2),
644
no_leading_whitespace(Cs2, Cs3),
645
- reverse(Cs3, Cs).
+ reverse(Cs3, Cs4),
646
+ single_intermediate_space(Cs4, Cs).
647
648
no_leading_whitespace([], []).
649
no_leading_whitespace([C0|Cs0], Cs) :-
650
( char_type(C0, whitespace) ->
651
no_leading_whitespace(Cs0, Cs)
652
; Cs = [C0|Cs0]
653
).
654
+
655
+single_intermediate_space([], []).
656
+single_intermediate_space([C0|Cs0], [C|Cs]) :-
657
+ ( char_type(C0, whitespace) ->
658
+ no_leading_whitespace(Cs0, Cs1),
659
+ C = ' ',
660
+ single_intermediate_space(Cs1, Cs)
661
+ ; C = C0,
662
+ single_intermediate_space(Cs0, Cs)
663
+ ).
0 commit comments