diff --git a/railway-routes.json b/railway-routes.json
index c3e928fa0..39ac63cfa 100644
--- a/railway-routes.json
+++ b/railway-routes.json
@@ -32,10 +32,14 @@
"title": "",
"body": [
"
Routes
",
- "",
+ "",
"{% for master in masters %}",
" {% set _color = '#' ~ master.tags.operator|default('')|md5|slice(0, 6) %}",
- " - {{ markerLine({ width: 4, color: _color })|raw }}{{ master.tags.name|default(master.tags.ref) }}{% if master.tags.network %} {{ master.tags.operator }}{% endif %}
",
+ " - ",
+ " {{ markerLine({ width: 4, color: _color })|raw }}",
+ " {% if master.tags.ref and master.tags.name %}{{ master.tags.ref }} - {{ master.tags.name|default(master.tags.ref) }}{% elseif master.tags.ref %}{{ master.tags.ref }}{% elseif master.tags.name %}{{ master.tags.name }}{% else %}{{ trans('unnamed') }}{% endif %}",
+ " {{ master.tags.operator }}",
+ "
",
"{% endfor %}",
"
"
],