mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	topic-mention: Add Marked implementation as HandleStreamTopic.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							0ba332bcc0
						
					
				
				
					commit
					3698cdcc58
				
			@@ -225,7 +225,18 @@ function handleStream(streamName) {
 | 
			
		||||
    return '<a class="stream" data-stream-id="' + stream.stream_id + '" ' +
 | 
			
		||||
        'href="' + href + '"' +
 | 
			
		||||
        '>' + '#' + escape(stream.name) + '</a>';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function handleStreamTopic(streamName, topic) {
 | 
			
		||||
    var stream = stream_data.get_sub(streamName);
 | 
			
		||||
    if (stream === undefined || !topic) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    var href = window.location.origin + '/#narrow/stream/' + hash_util.encode_stream_name(stream.name);
 | 
			
		||||
    href += '/topic/' + hash_util.encodeHashComponent(topic);
 | 
			
		||||
    var text = '#' + escape(stream.name) + ' > ' + escape(topic);
 | 
			
		||||
    return '<a class="stream-topic" data-stream-id="' + stream.stream_id + '" ' +
 | 
			
		||||
        'href="' + href + '"' + '>' + text + '</a>';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function handleRealmFilter(pattern, matches) {
 | 
			
		||||
@@ -498,6 +509,7 @@ exports.initialize = function () {
 | 
			
		||||
        avatarHandler: handleAvatar,
 | 
			
		||||
        unicodeEmojiHandler: handleUnicodeEmoji,
 | 
			
		||||
        streamHandler: handleStream,
 | 
			
		||||
        streamTopicHandler: handleStreamTopic,
 | 
			
		||||
        realmFilterHandler: handleRealmFilter,
 | 
			
		||||
        texHandler: handleTex,
 | 
			
		||||
        renderer: r,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user