Remove spaces and dashes from tel links

This commit is contained in:
2026-04-12 15:47:22 +04:00
parent 9e2545da7b
commit ad3e6ea402
3 changed files with 15 additions and 4 deletions

View File

@@ -142,7 +142,10 @@ export default class PlaceDetails extends Component {
if (type === 'phone') {
return htmlSafe(
parts.map((p) => `<a href="tel:${p}">${p}</a>`).join('<br>')
parts.map((p) => {
const safeTel = p.replace(/[\s-]+/g, '');
return `<a href="tel:${safeTel}">${p}</a>`;
}).join('<br>')
);
}