Use first address for map lookup
This commit is contained in:
@@ -1012,7 +1012,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function extractAddressForMap(value) {
|
function extractAddressForMap(value) {
|
||||||
let text = normalizeMapQuery(value)
|
const original = normalizeMapQuery(value);
|
||||||
|
const pointMatch = original.match(/\(시점\)\s*([^()]+?)(?=\s*\(종점\)|$)/);
|
||||||
|
if (pointMatch && pointMatch[1]) {
|
||||||
|
return normalizeMapQuery(pointMatch[1]);
|
||||||
|
}
|
||||||
|
const pointLabelMatch = original.match(/시점\s*[::]?\s*([^()]+?)(?=\s*종점\s*[::]?|$)/);
|
||||||
|
if (pointLabelMatch && pointLabelMatch[1]) {
|
||||||
|
return normalizeMapQuery(pointLabelMatch[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
let text = original
|
||||||
.replace(/^\(주\)\s*장헌\s*/, '')
|
.replace(/^\(주\)\s*장헌\s*/, '')
|
||||||
.replace(/^\(주\)장헌\s*/, '')
|
.replace(/^\(주\)장헌\s*/, '')
|
||||||
.replace(/^\[.*?\]\s*/, '')
|
.replace(/^\[.*?\]\s*/, '')
|
||||||
@@ -1026,6 +1036,7 @@
|
|||||||
}
|
}
|
||||||
text = text
|
text = text
|
||||||
.split(/\s*~\s*/)[0]
|
.split(/\s*~\s*/)[0]
|
||||||
|
.split(/\s+종점\s+/)[0]
|
||||||
.replace(/\s+/g, ' ')
|
.replace(/\s+/g, ' ')
|
||||||
.trim();
|
.trim();
|
||||||
return text;
|
return text;
|
||||||
|
|||||||
Reference in New Issue
Block a user