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

'&' in ofx file cause error, replace before parse in ofx.js file #73

Open
Davidsonc opened this issue Feb 13, 2024 · 1 comment
Open

Comments

@Davidsonc
Copy link

new code:
data.xml = ofx
// Remove empty spaces and line breaks between tags
.replace(/>\s+</g, '><')
// Remove empty spaces and line breaks before tags content
.replace(/\s+</g, '<')
// Remove empty spaces and line breaks after tags content
.replace(/>\s+/g, '>')
// Remove dots in start-tags names and remove end-tags with dots
.replace(/<([A-Z0-9_])+.+([A-Z0-9_])>([^<]+)(</\1.\2>)?/g, '<$1$2>$3')
// Add a new end-tags for the ofx elements
.replace(/<(\w+?)>([^<]+)/g, '<$1>$2</$1>')
// Remove duplicate end-tags
.replace(/</(\w+?)>(</\1>)?/g, '</$1>')
// replace '&' por 'e'
//######################################
.replace(/&/g, 'e');
;

@euforic
Copy link
Owner

euforic commented Feb 16, 2024

feel free to put in a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants