mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
updated: check entity type from second word as well
This commit is contained in:
committed by
Bryan Housel
parent
e0d5391f1b
commit
ed34d522ff
@@ -99,13 +99,14 @@ export function parseErrorDescriptions(entity) {
|
||||
var currWord = errorDescriptions[i];
|
||||
|
||||
// strip leading # if present
|
||||
if (currWord.charAt(0) === '#') {
|
||||
currWord = currWord.slice(1, currWord.length);
|
||||
if (currWord.charAt(0) === '#' || errorDescriptions[i-1] === '(id') {
|
||||
currWord = currWord.replace(/\D/g,'');
|
||||
|
||||
// get the entity type of the id
|
||||
var lastWord = errorDescriptions[i-1];
|
||||
var secondLastWord = errorDescriptions[i-2];
|
||||
var base;
|
||||
if (lastWord) { base = getEntityBase(lastWord); }
|
||||
if (lastWord) { base = getEntityBase(lastWord) || getEntityBase(secondLastWord); }
|
||||
if (!base) {
|
||||
base = getEntityBase(parsedDescriptions.slice(-1)[0].split(' ').slice(-1)[0]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user