Changeset 13541 in josm for trunk/src


Ignore:
Timestamp:
2018-03-18T23:36:36+01:00 (20 months ago)
Author:
Don-vip
Message:

fix #16104 - better support of space characters in values for tags copy/paste

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/TextTagParser.java

    r12846 r13541  
    3636        private boolean esc;
    3737        private final StringBuilder s = new StringBuilder(200);
     38        private String valueStops = "\n\r\t";
    3839        private int pos;
    3940        private final String data;
     
    4647        public TextAnalyzer(String text) {
    4748            pos = 0;
    48             data = text;
     49            data = Utils.strip(text);
    4950            n = data.length();
     51            // fix #1604: allow space characters as value stops for single-line input only
     52            if (data.indexOf('\r') == -1 && data.indexOf('\n') == -1) {
     53                valueStops += " ";
     54            }
    5055        }
    5156
     
    7378                    break;
    7479                }
    75                 v = parseString("\n\r\t ");
     80                v = parseString(valueStops);
    7681                tags.put(k, v);
    7782            }
Note: See TracChangeset for help on using the changeset viewer.