Skip to content

Commit

Permalink
Merge pull request #994 from geoadmin/fix-PB-714-kml-file-with-comments
Browse files Browse the repository at this point in the history
PB-714: Update regex to allow comments in kml before kml tag - #patch
  • Loading branch information
LukasJoss authored Jul 5, 2024
2 parents bf0a386 + 142cfad commit 2208080
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const dispatcher = { dispatcher: 'ImportFile/utils' }
* @returns {boolean}
*/
export function isKml(fileContent) {
return /^\s*(<\?xml\b[^>]*\?>)?\s*<(kml:)?kml\b[^>]*>[\s\S.]*<\/(kml:)?kml\s*>/g.test(
return /^\s*(<\?xml\b[^>]*\?>)?\s*(<!--(.*?)-->\s*)*<(kml:)?kml\b[^>]*>[\s\S.]*<\/(kml:)?kml\s*>/g.test(
fileContent
)
}
Expand Down

0 comments on commit 2208080

Please sign in to comment.