Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

typeahead: Remove all sources of white space inside `strong` element.

Aman Agrawal39bcb6bd8bd7
diff --git a/web/templates/inline_decorated_stream_name.hbs b/web/templates/inline_decorated_stream_name.hbs
index 32b687d79e3..561049e95ec 100644
--- a/web/templates/inline_decorated_stream_name.hbs
+++ b/web/templates/inline_decorated_stream_name.hbs
@@ -1,8 +1,8 @@
{{! This controls whether the swatch next to streams in the left sidebar has a lock icon. }}
-{{#if stream.invite_only }}
+{{~#if stream.invite_only ~}}
<i class="zulip-icon zulip-icon-lock stream-privacy-type-icon" {{#if show_colored_icon}}style="color: {{stream.color}}"{{/if}} aria-hidden="true"></i> {{stream.name ~}}
-{{ else if stream.is_web_public }}
+{{~ else if stream.is_web_public ~}}
<i class="zulip-icon zulip-icon-globe stream-privacy-type-icon" {{#if show_colored_icon}}style="color: {{stream.color}}"{{/if}} aria-hidden="true"></i> {{stream.name ~}}
-{{ else }}
+{{~ else ~}}
<i class="zulip-icon zulip-icon-hashtag stream-privacy-type-icon" {{#if show_colored_icon}}style="color: {{stream.color}}"{{/if}} aria-hidden="true"></i> {{stream.name ~}}
-{{/if}}
+{{~/if~}}
diff --git a/web/templates/typeahead_list_item.hbs b/web/templates/typeahead_list_item.hbs
index 69ca83601cc..a074a64b38e 100644
--- a/web/templates/typeahead_list_item.hbs
+++ b/web/templates/typeahead_list_item.hbs
@@ -19,11 +19,11 @@
{{!-- Separate container to ensure overflowing text remains in this container. --}}
<div class="typeahead-text-container">
<strong class="typeahead-strong-section">
- {{~#if stream}}
- {{> inline_decorated_stream_name stream=stream }}
- {{else}}
+ {{~#if stream~}}
+ {{~> inline_decorated_stream_name stream=stream ~}}
+ {{~else~}}
{{~ primary ~}}
- {{/if}}
+ {{~/if~}}
</strong>
{{~#if has_pronouns}}
<span class="pronouns">({{pronouns}})</span>
diff --git a/web/tests/composebox_typeahead.test.js b/web/tests/composebox_typeahead.test.js
index 8542d8332d6..c3ac41bc6c9 100644
--- a/web/tests/composebox_typeahead.test.js
+++ b/web/tests/composebox_typeahead.test.js
@@ -896,7 +896,7 @@ test("initialize", ({override, override_rewire, mock_template}) => {
actual_value = options.highlighter_html("kronor");
expected_value =
'<div class="typeahead-text-container">\n' +
- ' <strong class="typeahead-strong-section">kronor </strong></div>\n';
+ ' <strong class="typeahead-strong-section">kronor</strong></div>\n';
assert.equal(actual_value, expected_value);
// Highlighted content should be escaped.
@@ -904,14 +904,14 @@ test("initialize", ({override, override_rewire, mock_template}) => {
actual_value = options.highlighter_html("<&>");
expected_value =
'<div class="typeahead-text-container">\n' +
- ' <strong class="typeahead-strong-section">&lt;&amp;&gt; </strong></div>\n';
+ ' <strong class="typeahead-strong-section">&lt;&amp;&gt;</strong></div>\n';
assert.equal(actual_value, expected_value);
options.query = "even m";
actual_value = options.highlighter_html("even more ice");
expected_value =
'<div class="typeahead-text-container">\n' +
- ' <strong class="typeahead-strong-section">even more ice </strong></div>\n';
+ ' <strong class="typeahead-strong-section">even more ice</strong></div>\n';
assert.equal(actual_value, expected_value);
// options.sorter()
@@ -1136,7 +1136,7 @@ test("initialize", ({override, override_rewire, mock_template}) => {
` <span class="user_circle_empty user_circle"></span>\n` +
` <img class="typeahead-image" src="http://zulip.zulipdev.com/avatar/${othello.user_id}?s&#x3D;50" />\n` +
'<div class="typeahead-text-container">\n' +
- ' <strong class="typeahead-strong-section">Othello, the Moor of Venice </strong> <small class="autocomplete_secondary">[email protected]</small>\n' +
+ ' <strong class="typeahead-strong-section">Othello, the Moor of Venice</strong> <small class="autocomplete_secondary">[email protected]</small>\n' +
"</div>\n";
assert.equal(actual_value, expected_value);
// Reset the email such that this does not affect further tests.
@@ -1148,7 +1148,7 @@ test("initialize", ({override, override_rewire, mock_template}) => {
expected_value =
' <i class="typeahead-image zulip-icon zulip-icon-triple-users no-presence-circle" aria-hidden="true"></i>\n' +
'<div class="typeahead-text-container">\n' +
- ' <strong class="typeahead-strong-section">hamletcharacters </strong> <small class="autocomplete_secondary">Characters of Hamlet</small>\n' +
+ ' <strong class="typeahead-strong-section">hamletcharacters</strong> <small class="autocomplete_secondary">Characters of Hamlet</small>\n' +
"</div>\n";
assert.equal(actual_value, expected_value);