};
rivets.formatters.short_version = function(version) {
- // Turn "ceph version 1.2.3-g9asdasd (as98d7a0s8d7)"
- // into "1.2.3-g9asdasd"
- return /ceph version (.+) \(.+\)$/.exec(version)[1];
+ // Expect "ceph version 1.2.3-g9asdasd (as98d7a0s8d7)"
+ var result = /ceph version\s+([^ ]+)\s+\(.+\)/.exec(version);
+ if (result) {
+ // Return the "1.2.3-g9asdasd" part
+ return result[1];
+ } else {
+ // Unexpected format, pass it through
+ return version;
+ }
+ return
};
rivets.bind($("#content"), content_data);
</div>
</section>
-{% endblock %}
\ No newline at end of file
+{% endblock %}