Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@tbpgr

ずんだのMARQUEE問題

More than 1 year has passed since last update.

ルール

  • h1 - h6 の開き・閉じタグを marquee タグに変換する
  • scrollamount に h1 - h6 の数値を設定する。 h1 なら scrollamount = 1 , h6 なら scrollamount = 6

プログラム(Ruby)

puts DATA.read.gsub(/<h(\d)/, '<marquee scrollamount="\1"').gsub(/<\/h\d/, '</marquee')

__END__
<h1>test</h1>
<h2>test</h2>
<h3>test</h3>
<div>div test1</div>
<div>div test2</div>
<div>div test3</div>

出力

<marquee scrollamount="1">test</marquee>
<marquee scrollamount="2">test</marquee>
<marquee scrollamount="3">test</marquee>
<div>div test1</div>
<div>div test2</div>
<div>div test3</div>

出力結果をブラウザで表示

zunda_marquee.gif

0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
tbpgr
Rubyを扱う人事(研修開発、エンジニア採用) Learning Designer。 tbpgr の読み方は(てぃーびー) 個人ブログでも色々と情報を垂れ流してます。 http://tbpgr.hatenablog.com/
studist
「伝えることを、もっと簡単に」をミッションにビジュアルSOPマネジメントプラットフォームのBtoB SaaS「Teachme Biz」を開発・運営するスタートアップ

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?