echo '</form>';
echo $OUTPUT->container_end();
}
-}
+
+ /**
+ * Returns escaped token used by a wiki language to represent a given tag or "object" (bold -> **)
+ *
+ * @param string $format format of page
+ * @param array|string $token format tokens which needs to be escaped
+ * @return array|string
+ */
+ function getTokens($format, $token) {
+ $tokens = wiki_parser_get_token($format, $token);
+
+ if (is_array($tokens)) {
+ foreach ($tokens as $key => $value) {
+ $tokens[$key] = urlencode(str_replace("'", "\'", $value));
+ }
+ } else {
+ urlencode(str_replace("'", "\'", $token));
+ }
+
+ return $tokens;
++}