the browser-facing portion of osu!
at master 42 lines 1.1 kB view raw
1<?php 2 3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4// See the LICENCE file in the repository root for full licence text. 5 6namespace App\Libraries\Wiki; 7 8use App\Libraries\Markdown\OsuMarkdown; 9 10/** 11 * {@inheritdoc} 12 */ 13class MarkdownRenderer extends Renderer 14{ 15 /** 16 * {@inheritdoc} 17 */ 18 public function render() 19 { 20 return (new OsuMarkdown( 21 'wiki', 22 osuExtensionConfig: [ 23 'wiki_locale' => $this->page->locale, 24 'relative_url_root' => wiki_url($this->page->path, $this->page->locale, false, false), 25 ] 26 ))->load($this->body)->toArray(); 27 } 28 29 /** 30 * {@inheritdoc} 31 */ 32 public function renderIndexable() 33 { 34 return (new OsuMarkdown( 35 'wiki', 36 osuExtensionConfig: [ 37 'wiki_locale' => $this->page->locale, 38 'relative_url_root' => wiki_url($this->page->path, $this->page->locale, false, false), 39 ] 40 ))->load($this->body)->toIndexable(); 41 } 42}