PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.4
Elementor Website Builder – more than just a page builder v4.2.4
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | modules/markdown-render/markdown-renderer.php +14 -36 4.3.0-beta24.2.4 View file →
@@ -10,52 +10,30 @@
10 10
11 11 class Markdown_Renderer {
12 12
13 13 public function render( Document $document ): string {
14 - return Module::execute_while_rendering_markdown( function () use ( $document ) {
15 - $frontmatter = $this->build_frontmatter( $document );
16 - $data = $document->get_elements_data();
14 + $frontmatter = $this->build_frontmatter( $document );
15 + $data = $document->get_elements_data();
17 16
18 - if ( empty( $data ) ) {
19 - return $frontmatter;
20 - }
17 + if ( empty( $data ) ) {
18 + return $frontmatter;
19 + }
21 20
22 - $sections = [];
21 + $sections = [];
23 22
24 - foreach ( $data as $element_data ) {
25 - $md = $this->render_element( $element_data );
23 + foreach ( $data as $element_data ) {
24 + $md = $this->render_element( $element_data );
26 25
27 - if ( ! empty( trim( $md ) ) ) {
28 - $sections[] = $md;
29 - }
26 + if ( ! empty( trim( $md ) ) ) {
27 + $sections[] = $md;
30 28 }
29 + }
31 30
32 - $body = implode( "\n\n---\n\n", $sections );
31 + $body = implode( "\n\n---\n\n", $sections );
33 32
34 - $output = $frontmatter . "\n\n" . $body;
33 + $output = $frontmatter . "\n\n" . $body;
35 34
36 - return apply_filters( 'elementor/markdown/document_output', $output, $document );
37 - } );
38 - }
39 -
40 - public function render_elements_data( array $elements_data ): string {
41 - return Module::execute_while_rendering_markdown( function () use ( $elements_data ) {
42 - if ( empty( $elements_data ) ) {
43 - return '';
44 - }
45 -
46 - $sections = [];
47 -
48 - foreach ( $elements_data as $element_data ) {
49 - $md = $this->render_element( $element_data );
50 -
51 - if ( ! empty( trim( $md ) ) ) {
52 - $sections[] = $md;
53 - }
54 - }
55 -
56 - return implode( "\n\n", $sections );
57 - } );
35 + return apply_filters( 'elementor/markdown/document_output', $output, $document );
58 36 }
59 37
60 38 private function build_frontmatter( Document $document ): string {
61 39 $post_id = $document->get_main_id();