advanced-gutenberg-blocks to enlighter

Published by onesixx on

-- TEST 
SELECT  post_name, post_content, post_type, a.*
FROM onesixx.wp_posts a
Where post_content like '%<!-- wp:advanced-gutenberg-blocks/code {"language":"%' #html",%"source":"%'
and   post_type = "post"
-- and   post_name = "mmdet-train"
and   post_name in ("mmdet-training-log-analyze",
"map","coco","xml-parse","mysql-docker", "tensorflow-1-x-%ec%99%80-2-x-book-deep-learning-with-tensorflow-2-and-keras", 
"fastapi-ex","pandas", "tfkerascallbacks", "tensorflow-1-x", "merging-r", "plumber-ex0", "python-sublime-config")
order by post_date desc



-- 검증쿼리 
-- wp:advanced-gutenberg-blocks/code {"language

SELECT  post_name, post_content, post_type, a.*
FROM onesixx.wp_posts a
Where post_content like '%<!-- wp:advanced-gutenberg-blocks/code {"language":"%'
and post_type != "revision"
order by post_date desc


-- regedit
UPDATE onesixx.wp_posts wp
SET post_content = REGEXP_REPLACE(post_content,'"file":"(.*?)",', '');

UPDATE onesixx.wp_posts wp
SET post_content = REGEXP_REPLACE(post_content,'"highlightEnd":"(.*?)",', '');


-- unicode
UPDATE onesixx.wp_posts wp SET post_content = REPLACE(post_content, '\\u003e', '>');
UPDATE onesixx.wp_posts wp SET post_content = REPLACE(post_content, '\\u003c', '<');
UPDATE onesixx.wp_posts wp SET post_content = REPLACE(post_content, '\\u0022', '"');
UPDATE onesixx.wp_posts wp SET post_content = REPLACE(post_content, '\\u002d', '-');
UPDATE onesixx.wp_posts wp SET post_content = REPLACE(post_content, '\\u0026', '&');

-- /n 변경 

UPDATE onesixx.wp_posts
SET post_content = REPLACE(REPLACE(post_content, '\\n', CHAR(13)), '\\n', CHAR(10))
Where post_content like '%<!-- wp:advanced-gutenberg-blocks/code {"language":"%'
;
commit;

-- LANGAGE UPDATE 
UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"yaml","source":"', 
'<!-- wp:enlighter/codeblock {"language":"yaml","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"go","source":"', 
'<!-- wp:enlighter/codeblock {"language":"golang","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="golang" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"css","source":"', 
'<!-- wp:enlighter/codeblock {"language":"css","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="css" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">');
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"plain","source":"', 
'<!-- wp:enlighter/codeblock {"language":"raw","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="raw" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"html","source":"', 
'<!-- wp:enlighter/codeblock {"language":"html","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="html" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"r","source":"', 
'<!-- wp:enlighter/codeblock {"language":"r","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="r" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"python","source":"', 
'<!-- wp:enlighter/codeblock {"language":"python","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;


UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"sql","source":"', 
'<!-- wp:enlighter/codeblock {"language":"sql","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="sql" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"js","source":"', 
'<!-- wp:enlighter/codeblock {"language":"js","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="js" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"json","source":"', 
'<!-- wp:enlighter/codeblock {"language":"json","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="json" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"php","source":"', 
'<!-- wp:enlighter/codeblock {"language":"php","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="php" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"java","source":"', 
'<!-- wp:enlighter/codeblock {"language":"java","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"shell","source":"', 
'<!-- wp:enlighter/codeblock {"language":"powershell","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="powershell" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;


UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"c","source":"', 
'<!-- wp:enlighter/codeblock {"language":"c","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="c" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"swift","source":"', 
'<!-- wp:enlighter/codeblock {"language":"swift","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="swift" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;


UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content,
'<!-- wp:advanced-gutenberg-blocks/code {"language":"xml","source":"', 
'<!-- wp:enlighter/codeblock {"language":"xml","theme":"monokai"} --> <pre class="EnlighterJSRAW" data-enlighter-language="xml" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">')
;
commit;

-- edit END POINT 


UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content, '","showLines":false,"wrapLines":false} /-->',
'</pre> <!-- /wp:enlighter/codeblock -->')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content, '","wrapLines":false} /-->',
'</pre> <!-- /wp:enlighter/codeblock -->')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content, '","showLines":false} /-->',
'</pre> <!-- /wp:enlighter/codeblock -->')
;
commit;

UPDATE onesixx.wp_posts
SET post_content = REPLACE (post_content, '"} /-->',
'</pre> <!-- /wp:enlighter/codeblock -->')
;
commit;
Categories: BLOG

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x