Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve jruby support of ComplexFields #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/sablon/parser/mail_merge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def pattern_node
end

def separate_node
@nodes.detect {|n| !n.search(".//w:fldChar[@w:fldCharType='separate']").empty? }
@nodes.detect {|n| !n.search(".//w:fldChar[@*[local-name()='fldCharType' and .='separate']]").empty? }
end
end

Expand Down Expand Up @@ -147,7 +147,7 @@ def parse_fields(xml)
def build_complex_field(node)
possible_field_node = node.parent
field_nodes = [possible_field_node]
while possible_field_node && possible_field_node.search(".//w:fldChar[@w:fldCharType='end']").empty?
while possible_field_node && possible_field_node.search(".//w:fldChar[@*[local-name()='fldCharType' and .='end']]").empty?
possible_field_node = possible_field_node.next_element
field_nodes << possible_field_node
end
Expand Down