Kaynağa Gözat

Add hashtag to SCEditor

Visman 2 yıl önce
ebeveyn
işleme
38fbadc409

+ 15 - 0
public/js/sc/formats/bbcode.js

@@ -864,6 +864,21 @@
 		},
 		// END_COMMAND
 
+		// START_COMMAND: Hashtag
+		hashtag: {
+			tags: {
+				span: {
+					class: 'f-bb-hashtag'
+				}
+			},
+			isInline: true,
+			format: function (element, content) {
+				return '[hashtag]' + content.replace(/(^\s+|\s+$)/g, '') + '[/hashtag]';
+			},
+			html: '<span class="f-bb-hashtag">{0}</span>'
+		},
+		// END_COMMAND
+
 		// START_COMMAND: Spoiler
 		spoiler: {
 			tags: {

+ 6 - 0
public/style/ForkBB/sccontent.css

@@ -244,3 +244,9 @@ div.f-bb-s-body {
   padding: 0.625rem;
   border-inline-start: 0.1875rem solid #AA7939;
 }
+
+span.f-bb-hashtag {
+  color: #583200;
+  border-bottom-style: dashed;
+  border-bottom-width: 0.0625rem;
+}