0

我有一个我正在为大学设计的 Joomla 网站。用户应该能够发布与 Android 编程相关的教程。

http://www.jciadt.com/cms/ca

目前我正在尝试让用户发布的文章成功显示代码片段。

我研究过使用这个扩展:

http://alexgorbatchev.com/SyntaxHighlighter/

它看起来是一个可行的选择,但是当我包含代码片段时,我的文章中出现了不希望的结果:

见下文:

http://www.jciadt.com/cms/ca/index.php/tutorials/beginner/9-layout-ui-options-part-i

滚动到页面底部到嵌套列表部分,看看我的意思。

有谁知道可能是什么问题?

4

1 回答 1

0

我会采取以下方法来确定发生了什么:

#1比较内容,即原始源代码以确保其格式正确。如果您将<Button元素的缩进和各种android:属性称为问题,我注意到的一件事是,在链接的页面中,与前几行相比,它们前面的空格数量错误。之前的所有行似乎都使用标准4 spacestab站,最后一组使用 6 个空格。

当我将您的代码复制到此答案中时,我看到了同样的问题,所以我猜它在您的原始代码中。

<LinearLayout ... >
  <TextView ... />
  <EditText ... />
  <LinearLayout
    android:layout_gravity="center" 
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"  >   

<Button
      android:layout_width="150dp"
      android:layout_height="wrap_content"
      android:layout_gravity="center" 
      android:layout_weight="1"
      android:padding="5dp"
      android:gravity="center"
      android:text="@string/setName" />
    <Button
      android:layout_width="150dp"
      android:layout_gravity="center" 
      android:layout_height="wrap_content"
      android:layout_weight="1"
      android:padding="5dp"
      android:gravity="center"
      android:text="@string/clearName" />
  </LinearLayout>
</LinearLayout>

#2如果内容正确,那么考虑到Joomla 扩展目录( JED )上有多少不同的代码荧光笔扩展,我会尝试几种不同的。如果他们都有相同的问题,那么您可能错过了代码示例中的某些内容。

于 2013-11-20T21:11:01.823 回答