Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

second attempt to get tags correctly linked #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion App/StackExchange.DataExplorer/Scripts/query.resultset.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,15 @@

function tagFormatter(siteColumnName) {
var siteColumnName = siteColumnName;
var unicodeSupport = new RegExp().unicode != undefined; // IE11 will not have unicode support

return function (row, cell, value, column, context) {
var isMultiTags;
// use unicode if it is supported. Don't break IE11 by trying to do /[\p{L}]/u, use the RegExp contructor instead
var singleTagRegExp = unicodeSupport ? new RegExp('^[\\p{L}a-z0-9#.+-]+$', 'u') : /^[a-z0-9#.+-]+$/;
var multiTagRegExp = unicodeSupport ? new RegExp('^(?:<[\\p{L}a-z0-9#.+-]+>)+$', 'u') : /^(?:<[a-z0-9#.+-]+>)+$/;

if (!value || !(value.match(/^[a-z0-9#.+-]+$/) || (isMultiTags = (value.search(/^(?:<[a-z0-9#.+-]+>)+$/) > -1)))) {
if (!value || !(value.match(singleTagRegExp) || (isMultiTags = (value.search(multiTagRegExp) > -1)))) {
return defaultFormatter(row, cell, value, column, context);
}

Expand Down