MyBB Community Forums
[MyCode] Inline code - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: MyCodes (https://community.mybb.com/forum-117.html)
+--- Thread: [MyCode] Inline code (/thread-223214.html)



[MyCode] Inline code - Crazycat - 2019-05-29

This short MyCode allow to use ` symbol to display inline code (as it's done here).

Regular Expression
(?U-s)`(.+)`

Replacement
<code class="inline-code">$1</code>

css
.inline-code {
	background: #00bcd4;
	padding: 1px;
	border: solid 1px #EEE;
	border-radius: 3px;
	word-wrap: break-word;
	font-family: Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;
	font-size: 12px;
}

Note the modifiers at the begining of the regexp: U (makes ungreedy) and -s (to force the single-line)